--------------------------------------------------------------------------------------------------------------------------------------------------------------------
      name:  <unnamed>
       log:  C:\temp\Data&Methods\DataAnalysis\analysis14 Sep 2022.log
  log type:  text
 opened on:  14 Sep 2022, 14:46:16

.         
.         set more 1

.         set scheme sol

.         set autotabgraphs on  

.         
.         * Treatments:   1= NEUTRAL (points= +3 for all)                 4 sessions order 2-2-12-12 + 4 sessions reverse order
.         *                               2= CONVERGE  (points=  + 5,  +3, + 1)           4 sessions order 2-2-12-12  + 4 sessions reverse order
.         *                               3= DIVERGE (points= +1, +3, + 5)                        4 sessions order 2-2-12-12 + 4 sessions reverse order
.         *                               4= NEUTRAL+ (points= + 5 for all)                       4 sessions order 2-2-12-12 + 4 sessions reverse order
.         *                               5= NEUTRAL-CHAT (points= + 3 for all)   4 sessions order 2-2-12-12
. 
.         use workingdata.dta

.         macro define data "workingdata.dta, clear"

. 
. 
. *       OVERVIEW
.         distinct treat ymd ID

----------------------------------
           |     total   distinct
-----------+----------------------
 treatment |     89976          5
       ymd |     89976         32
        ID |     89976        864
----------------------------------

.         sort treat groupID

.         
.         by treat: distinct groupID if groupsize==2 & game<5

--------------------------------------------------------------------------------------------------------------------------------------------------------------------
-> treatment = Neutral

--------------------------------
         |     total   distinct
---------+----------------------
 groupID |      7800        192
--------------------------------

--------------------------------------------------------------------------------------------------------------------------------------------------------------------
-> treatment = Converge

--------------------------------
         |     total   distinct
---------+----------------------
 groupID |      7464        192
--------------------------------

--------------------------------------------------------------------------------------------------------------------------------------------------------------------
-> treatment = Diverge

--------------------------------
         |     total   distinct
---------+----------------------
 groupID |      7632        192
--------------------------------

--------------------------------------------------------------------------------------------------------------------------------------------------------------------
-> treatment = Neutral+

--------------------------------
         |     total   distinct
---------+----------------------
 groupID |      8136        192
--------------------------------

--------------------------------------------------------------------------------------------------------------------------------------------------------------------
-> treatment = Neutral-Chat

--------------------------------
         |     total   distinct
---------+----------------------
 groupID |      4368         96
--------------------------------

.         by treat: distinct groupID if groupsize==12

--------------------------------------------------------------------------------------------------------------------------------------------------------------------
-> treatment = Neutral

--------------------------------
         |     total   distinct
---------+----------------------
 groupID |      7680         32
--------------------------------

--------------------------------------------------------------------------------------------------------------------------------------------------------------------
-> treatment = Converge

--------------------------------
         |     total   distinct
---------+----------------------
 groupID |      8472         32
--------------------------------

--------------------------------------------------------------------------------------------------------------------------------------------------------------------
-> treatment = Diverge

--------------------------------
         |     total   distinct
---------+----------------------
 groupID |      8256         32
--------------------------------

--------------------------------------------------------------------------------------------------------------------------------------------------------------------
-> treatment = Neutral+

--------------------------------
         |     total   distinct
---------+----------------------
 groupID |      8016         32
--------------------------------

--------------------------------------------------------------------------------------------------------------------------------------------------------------------
-> treatment = Neutral-Chat

--------------------------------
         |     total   distinct
---------+----------------------
 groupID |      3768         16
--------------------------------

.         by treat: distinct groupID if groupsize==2 & game==5

--------------------------------------------------------------------------------------------------------------------------------------------------------------------
-> treatment = Neutral

--------------------------------
         |     total   distinct
---------+----------------------
 groupID |      1288         32
--------------------------------

--------------------------------------------------------------------------------------------------------------------------------------------------------------------
-> treatment = Converge

--------------------------------
         |     total   distinct
---------+----------------------
 groupID |      1032         24
--------------------------------

--------------------------------------------------------------------------------------------------------------------------------------------------------------------
-> treatment = Diverge

--------------------------------
         |     total   distinct
---------+----------------------
 groupID |      1240         28
--------------------------------

--------------------------------------------------------------------------------------------------------------------------------------------------------------------
-> treatment = Neutral+

--------------------------------
         |     total   distinct
---------+----------------------
 groupID |       904         20
--------------------------------

--------------------------------------------------------------------------------------------------------------------------------------------------------------------
-> treatment = Neutral-Chat

--------------------------------
         |     total   distinct
---------+----------------------
 groupID |       328          8
--------------------------------

.         by treat: distinct groupID if groupsize>2 & game==5

--------------------------------------------------------------------------------------------------------------------------------------------------------------------
-> treatment = Neutral

--------------------------------
         |     total   distinct
---------+----------------------
 groupID |      2576          8
--------------------------------

--------------------------------------------------------------------------------------------------------------------------------------------------------------------
-> treatment = Converge

--------------------------------
         |     total   distinct
---------+----------------------
 groupID |      3000          8
--------------------------------

--------------------------------------------------------------------------------------------------------------------------------------------------------------------
-> treatment = Diverge

--------------------------------
         |     total   distinct
---------+----------------------
 groupID |      2912          8
--------------------------------

--------------------------------------------------------------------------------------------------------------------------------------------------------------------
-> treatment = Neutral+

--------------------------------
         |     total   distinct
---------+----------------------
 groupID |      3560          8
--------------------------------

--------------------------------------------------------------------------------------------------------------------------------------------------------------------
-> treatment = Neutral-Chat

--------------------------------
         |     total   distinct
---------+----------------------
 groupID |      1544          4
--------------------------------

.         
.         by treat: distinct ID

--------------------------------------------------------------------------------------------------------------------------------------------------------------------
-> treatment = Neutral

---------------------------
    |     total   distinct
----+----------------------
 ID |     19344        192
---------------------------

--------------------------------------------------------------------------------------------------------------------------------------------------------------------
-> treatment = Converge

---------------------------
    |     total   distinct
----+----------------------
 ID |     19968        192
---------------------------

--------------------------------------------------------------------------------------------------------------------------------------------------------------------
-> treatment = Diverge

---------------------------
    |     total   distinct
----+----------------------
 ID |     20040        192
---------------------------

--------------------------------------------------------------------------------------------------------------------------------------------------------------------
-> treatment = Neutral+

---------------------------
    |     total   distinct
----+----------------------
 ID |     20616        192
---------------------------

--------------------------------------------------------------------------------------------------------------------------------------------------------------------
-> treatment = Neutral-Chat

---------------------------
    |     total   distinct
----+----------------------
 ID |     10008         96
---------------------------

. 
.         bysort treat: tab a country if groupsize==12

--------------------------------------------------------------------------------------------------------------------------------------------------------------------
-> treatment = Neutral

   Gain in |
cooperatio |
  n payoff |
  -- mixed |
    groups |
(integrate |
         d |             Country
economies) |   Disadv.     Middle     Advan. |     Total
-----------+---------------------------------+----------
         3 |     2,560      2,560      2,560 |     7,680 
-----------+---------------------------------+----------
     Total |     2,560      2,560      2,560 |     7,680 

--------------------------------------------------------------------------------------------------------------------------------------------------------------------
-> treatment = Converge

   Gain in |
cooperatio |
  n payoff |
  -- mixed |
    groups |
(integrate |
         d |             Country
economies) |   Disadv.     Middle     Advan. |     Total
-----------+---------------------------------+----------
         1 |         0          0      2,824 |     2,824 
         3 |         0      2,824          0 |     2,824 
         5 |     2,824          0          0 |     2,824 
-----------+---------------------------------+----------
     Total |     2,824      2,824      2,824 |     8,472 

--------------------------------------------------------------------------------------------------------------------------------------------------------------------
-> treatment = Diverge

   Gain in |
cooperatio |
  n payoff |
  -- mixed |
    groups |
(integrate |
         d |             Country
economies) |   Disadv.     Middle     Advan. |     Total
-----------+---------------------------------+----------
         1 |     2,752          0          0 |     2,752 
         3 |         0      2,752          0 |     2,752 
         5 |         0          0      2,752 |     2,752 
-----------+---------------------------------+----------
     Total |     2,752      2,752      2,752 |     8,256 

--------------------------------------------------------------------------------------------------------------------------------------------------------------------
-> treatment = Neutral+

   Gain in |
cooperatio |
  n payoff |
  -- mixed |
    groups |
(integrate |
         d |             Country
economies) |   Disadv.     Middle     Advan. |     Total
-----------+---------------------------------+----------
         5 |     2,672      2,672      2,672 |     8,016 
-----------+---------------------------------+----------
     Total |     2,672      2,672      2,672 |     8,016 

--------------------------------------------------------------------------------------------------------------------------------------------------------------------
-> treatment = Neutral-Chat

   Gain in |
cooperatio |
  n payoff |
  -- mixed |
    groups |
(integrate |
         d |             Country
economies) |   Disadv.     Middle     Advan. |     Total
-----------+---------------------------------+----------
         3 |     1,256      1,256      1,256 |     3,768 
-----------+---------------------------------+----------
     Total |     1,256      1,256      1,256 |     3,768 


.         bysort treat: tab order game  if period==1 & subject==1

--------------------------------------------------------------------------------------------------------------------------------------------------------------------
-> treatment = Neutral

   Order of |                       Supergame
    session |         1          2          3          4          5 |     Total
------------+-------------------------------------------------------+----------
pairs first |         4          4          4          4          4 |        20 
large first |         4          4          4          4          4 |        20 
------------+-------------------------------------------------------+----------
      Total |         8          8          8          8          8 |        40 

--------------------------------------------------------------------------------------------------------------------------------------------------------------------
-> treatment = Converge

   Order of |                       Supergame
    session |         1          2          3          4          5 |     Total
------------+-------------------------------------------------------+----------
pairs first |         4          4          4          4          4 |        20 
large first |         4          4          4          4          4 |        20 
------------+-------------------------------------------------------+----------
      Total |         8          8          8          8          8 |        40 

--------------------------------------------------------------------------------------------------------------------------------------------------------------------
-> treatment = Diverge

   Order of |                       Supergame
    session |         1          2          3          4          5 |     Total
------------+-------------------------------------------------------+----------
pairs first |         4          4          4          4          4 |        20 
large first |         4          4          4          4          4 |        20 
------------+-------------------------------------------------------+----------
      Total |         8          8          8          8          8 |        40 

--------------------------------------------------------------------------------------------------------------------------------------------------------------------
-> treatment = Neutral+

   Order of |                       Supergame
    session |         1          2          3          4          5 |     Total
------------+-------------------------------------------------------+----------
pairs first |         4          4          4          4          4 |        20 
large first |         4          4          4          4          4 |        20 
------------+-------------------------------------------------------+----------
      Total |         8          8          8          8          8 |        40 

--------------------------------------------------------------------------------------------------------------------------------------------------------------------
-> treatment = Neutral-Chat

   Order of |                       Supergame
    session |         1          2          3          4          5 |     Total
------------+-------------------------------------------------------+----------
pairs first |         4          4          4          4          4 |        20 
------------+-------------------------------------------------------+----------
      Total |         4          4          4          4          4 |        20 


.         
.         tabstat duration paid payoffCQ1 sex, stat(mean sd min max) col(stat) f(%6.2f) long

    Variable |      Mean        SD       Min       Max
-------------+----------------------------------------
    duration |     21.32      3.53     18.00     36.00
        paid |     22.62      5.75      5.00     43.00
   payoffCQ1 |      1.92      0.44      0.25      2.50
         sex |      0.43      0.49      0.00      1.00
------------------------------------------------------

. 
.         table (treat partnership) (country) , statistic(mean  beta_star)  nformat(%9.2f) nototals

----------------------------------------------------
                        |           Country         
                        |  Disadv.   Middle   Advan.
------------------------+---------------------------
Treatment               |                           
  Neutral               |                           
    Group Configuration |                           
      Mixed Group       |     0.55     0.46     0.40
      Fixed Pair        |     0.75     0.60     0.50
  Converge              |                           
    Group Configuration |                           
      Mixed Group       |     0.46     0.46     0.46
      Fixed Pair        |     0.75     0.60     0.50
  Diverge               |                           
    Group Configuration |                           
      Mixed Group       |     0.67     0.46     0.35
      Fixed Pair        |     0.75     0.60     0.50
  Neutral+              |                           
    Group Configuration |                           
      Mixed Group       |     0.46     0.40     0.35
      Fixed Pair        |     0.75     0.60     0.50
  Neutral-Chat          |                           
    Group Configuration |                           
      Mixed Group       |     0.55     0.46     0.40
      Fixed Pair        |     0.75     0.60     0.50
----------------------------------------------------

.         table (treat) (session) , statistic(mean duration)  statistic(sd duration)  nformat(%9.1f) totals(treat)        

---------------------------------------------------------------------------------------
                       |                             Session                           
                       |     1      2      3      4      5      6      7      8   Total
-----------------------+---------------------------------------------------------------
Treatment              |                                                               
  Neutral              |                                                               
    Mean               |  21.3   21.3   19.3   20.1   20.6   21.1   19.3   20.6    20.5
    Standard deviation |   3.3    3.5    1.2    1.7    2.8    3.6    1.2    2.1     2.7
  Converge             |                                                               
    Mean               |  22.5   21.8   22.9   21.8   20.5   19.0   21.6   19.1    21.2
    Standard deviation |   4.8    3.6    3.4    3.0    1.6    0.6    1.8    1.3     3.2
  Diverge              |                                                               
    Mean               |  20.9   22.4   21.1   25.1   21.3   21.0   19.1   20.6    21.5
    Standard deviation |   2.7    4.7    2.3    7.5    3.3    2.9    1.6    1.9     4.2
  Neutral+             |                                                               
    Mean               |  20.6   23.0   22.0   20.2   23.6   22.5   22.2   21.8    22.0
    Standard deviation |   1.9    3.9    5.1    1.9    4.9    3.2    2.0    3.0     3.6
  Neutral-Chat         |                                                               
    Mean               |  21.6   21.0   22.3   20.2                                21.3
    Standard deviation |   3.3    2.3    4.9    1.9                                 3.4
---------------------------------------------------------------------------------------

.         
. 
. *===============================================
. *   COOPERATION  in PHASE 1  (1 obs = 1 economy)
. *===============================================
. use $data 

. preserve

.         drop if game==5
(18,384 observations deleted)

.         gen outcome1=outcome if period==1
(68,136 missing values generated)

.         collapse outcome outcome1, by(treatment sessionID groupID groupsize)            

. 
.         table (treat) (groupsize) , statistic(mean  outcome)  statistic(sd outcome)   nformat(%9.3f) nototal

----------------------------------------
                       |   Economy Size 
                       |       2      12
-----------------------+----------------
Treatment              |                
  Neutral              |                
    Mean               |   0.776   0.397
    Standard deviation |   0.338   0.198
  Converge             |                
    Mean               |   0.774   0.384
    Standard deviation |   0.338   0.185
  Diverge              |                
    Mean               |   0.656   0.333
    Standard deviation |   0.374   0.176
  Neutral+             |                
    Mean               |   0.668   0.421
    Standard deviation |   0.381   0.192
  Neutral-Chat         |                
    Mean               |   0.823   0.938
    Standard deviation |   0.292   0.076
----------------------------------------

.         table (treat) (groupsize) , statistic(mean  outcome1)  nformat(%9.2f) nototal

--------------------------------
               |   Economy Size 
               |       2      12
---------------+----------------
Treatment      |                
  Neutral      |    0.73    0.46
  Converge     |    0.75    0.60
  Diverge      |    0.65    0.44
  Neutral+     |    0.65    0.55
  Neutral-Chat |    0.90    1.00
--------------------------------

. restore

. 
. 
. *====================================================================================================
. *   COOPERATION  in PHASE 1  (1 obs= 1 session; Two-sided Wilcoxon-Mann Whitney ranksum test with exact statistics)
. *====================================================================================================
. preserve

.         drop if game==5
(18,384 observations deleted)

.         gen outcome1=outcome if period==1
(68,136 missing values generated)

.         collapse outcome outcome1, by(treatment sessionID groupsize)

.                 
.         local groupsize  "2  12"

.         foreach i of local groupsize {
  2.                 dis "==       COOPERATION Phase 1:  groupsize =" `i'  "     =="
  3.                 dis "***************************************************** "
  4.                 ranksum outcome if groupsize==`i' & inlist(treatment, 1,2), by(treatment)
  5.                 ranksum outcome if groupsize==`i' & inlist(treatment, 1,3), by(treatment)
  6.                 ranksum outcome if groupsize==`i' & inlist(treatment, 1,4), by(treatment)
  7.                 ranksum outcome if groupsize==`i' & inlist(treatment, 2,3), by(treatment)
  8.                 ranksum outcome if groupsize==`i' & inlist(treatment, 2,4), by(treatment)
  9.                 ranksum outcome if groupsize==`i' & inlist(treatment, 3,4), by(treatment)
 10.                 ranksum outcome if groupsize==`i' & inlist(treatment, 1,5), by(treatment)
 11.         }
==       COOPERATION Phase 1:  groupsize =2     ==
***************************************************** 

Two-sample Wilcoxon rank-sum (Mann–Whitney) test

   treatment |      Obs    Rank sum    Expected
-------------+---------------------------------
     Neutral |        8          66          68
    Converge |        8          70          68
-------------+---------------------------------
    Combined |       16         136         136

Unadjusted variance       90.67
Adjustment for ties        0.00
                     ----------
Adjusted variance         90.67

H0: outcome(treatm~t==Neutral) = outcome(treatm~t==Converge)
         z = -0.210
Prob > |z| = 0.8336
Exact prob = 0.8785

Two-sample Wilcoxon rank-sum (Mann–Whitney) test

   treatment |      Obs    Rank sum    Expected
-------------+---------------------------------
     Neutral |        8          81          68
     Diverge |        8          55          68
-------------+---------------------------------
    Combined |       16         136         136

Unadjusted variance       90.67
Adjustment for ties        0.00
                     ----------
Adjusted variance         90.67

H0: outcome(treatm~t==Neutral) = outcome(treatm~t==Diverge)
         z =  1.365
Prob > |z| = 0.1722
Exact prob = 0.1949

Two-sample Wilcoxon rank-sum (Mann–Whitney) test

   treatment |      Obs    Rank sum    Expected
-------------+---------------------------------
     Neutral |        8        89.5          68
    Neutral+ |        8        46.5          68
-------------+---------------------------------
    Combined |       16         136         136

Unadjusted variance       90.67
Adjustment for ties       -0.13
                     ----------
Adjusted variance         90.53

H0: outcome(treatm~t==Neutral) = outcome(treatm~t==Neutral+)
         z =  2.260
Prob > |z| = 0.0238
Exact prob = 0.0225

Two-sample Wilcoxon rank-sum (Mann–Whitney) test

   treatment |      Obs    Rank sum    Expected
-------------+---------------------------------
    Converge |        8          81          68
     Diverge |        8          55          68
-------------+---------------------------------
    Combined |       16         136         136

Unadjusted variance       90.67
Adjustment for ties        0.00
                     ----------
Adjusted variance         90.67

H0: outcome(treatm~t==Converge) = outcome(treatm~t==Diverge)
         z =  1.365
Prob > |z| = 0.1722
Exact prob = 0.1949

Two-sample Wilcoxon rank-sum (Mann–Whitney) test

   treatment |      Obs    Rank sum    Expected
-------------+---------------------------------
    Converge |        8          90          68
    Neutral+ |        8          46          68
-------------+---------------------------------
    Combined |       16         136         136

Unadjusted variance       90.67
Adjustment for ties        0.00
                     ----------
Adjusted variance         90.67

H0: outcome(treatm~t==Converge) = outcome(treatm~t==Neutral+)
         z =  2.310
Prob > |z| = 0.0209
Exact prob = 0.0207

Two-sample Wilcoxon rank-sum (Mann–Whitney) test

   treatment |      Obs    Rank sum    Expected
-------------+---------------------------------
     Diverge |        8          70          68
    Neutral+ |        8          66          68
-------------+---------------------------------
    Combined |       16         136         136

Unadjusted variance       90.67
Adjustment for ties        0.00
                     ----------
Adjusted variance         90.67

H0: outcome(treatm~t==Diverge) = outcome(treatm~t==Neutral+)
         z =  0.210
Prob > |z| = 0.8336
Exact prob = 0.8785

Two-sample Wilcoxon rank-sum (Mann–Whitney) test

   treatment |      Obs    Rank sum    Expected
-------------+---------------------------------
     Neutral |        8          46          52
Neutral-Chat |        4          32          26
-------------+---------------------------------
    Combined |       12          78          78

Unadjusted variance       34.67
Adjustment for ties        0.00
                     ----------
Adjusted variance         34.67

H0: outcome(treatm~t==Neutral) = outcome(treatm~t==Neutral-Chat)
         z = -1.019
Prob > |z| = 0.3082
Exact prob = 0.3677
==       COOPERATION Phase 1:  groupsize =12     ==
***************************************************** 

Two-sample Wilcoxon rank-sum (Mann–Whitney) test

   treatment |      Obs    Rank sum    Expected
-------------+---------------------------------
     Neutral |        8          72          68
    Converge |        8          64          68
-------------+---------------------------------
    Combined |       16         136         136

Unadjusted variance       90.67
Adjustment for ties        0.00
                     ----------
Adjusted variance         90.67

H0: outcome(treatm~t==Neutral) = outcome(treatm~t==Converge)
         z =  0.420
Prob > |z| = 0.6744
Exact prob = 0.7209

Two-sample Wilcoxon rank-sum (Mann–Whitney) test

   treatment |      Obs    Rank sum    Expected
-------------+---------------------------------
     Neutral |        8          76          68
     Diverge |        8          60          68
-------------+---------------------------------
    Combined |       16         136         136

Unadjusted variance       90.67
Adjustment for ties        0.00
                     ----------
Adjusted variance         90.67

H0: outcome(treatm~t==Neutral) = outcome(treatm~t==Diverge)
         z =  0.840
Prob > |z| = 0.4008
Exact prob = 0.4418

Two-sample Wilcoxon rank-sum (Mann–Whitney) test

   treatment |      Obs    Rank sum    Expected
-------------+---------------------------------
     Neutral |        8          63          68
    Neutral+ |        8          73          68
-------------+---------------------------------
    Combined |       16         136         136

Unadjusted variance       90.67
Adjustment for ties        0.00
                     ----------
Adjusted variance         90.67

H0: outcome(treatm~t==Neutral) = outcome(treatm~t==Neutral+)
         z = -0.525
Prob > |z| = 0.5995
Exact prob = 0.6454

Two-sample Wilcoxon rank-sum (Mann–Whitney) test

   treatment |      Obs    Rank sum    Expected
-------------+---------------------------------
    Converge |        8          76          68
     Diverge |        8          60          68
-------------+---------------------------------
    Combined |       16         136         136

Unadjusted variance       90.67
Adjustment for ties        0.00
                     ----------
Adjusted variance         90.67

H0: outcome(treatm~t==Converge) = outcome(treatm~t==Diverge)
         z =  0.840
Prob > |z| = 0.4008
Exact prob = 0.4418

Two-sample Wilcoxon rank-sum (Mann–Whitney) test

   treatment |      Obs    Rank sum    Expected
-------------+---------------------------------
    Converge |        8          61          68
    Neutral+ |        8          75          68
-------------+---------------------------------
    Combined |       16         136         136

Unadjusted variance       90.67
Adjustment for ties        0.00
                     ----------
Adjusted variance         90.67

H0: outcome(treatm~t==Converge) = outcome(treatm~t==Neutral+)
         z = -0.735
Prob > |z| = 0.4622
Exact prob = 0.5054

Two-sample Wilcoxon rank-sum (Mann–Whitney) test

   treatment |      Obs    Rank sum    Expected
-------------+---------------------------------
     Diverge |        8          55          68
    Neutral+ |        8          81          68
-------------+---------------------------------
    Combined |       16         136         136

Unadjusted variance       90.67
Adjustment for ties        0.00
                     ----------
Adjusted variance         90.67

H0: outcome(treatm~t==Diverge) = outcome(treatm~t==Neutral+)
         z = -1.365
Prob > |z| = 0.1722
Exact prob = 0.1949

Two-sample Wilcoxon rank-sum (Mann–Whitney) test

   treatment |      Obs    Rank sum    Expected
-------------+---------------------------------
     Neutral |        8          36          52
Neutral-Chat |        4          42          26
-------------+---------------------------------
    Combined |       12          78          78

Unadjusted variance       34.67
Adjustment for ties        0.00
                     ----------
Adjusted variance         34.67

H0: outcome(treatm~t==Neutral) = outcome(treatm~t==Neutral-Chat)
         z = -2.717
Prob > |z| = 0.0066
Exact prob = 0.0040

. 
.                 dis "==       COOP MIXED GROUPS  In period 1   =="
==       COOP MIXED GROUPS  In period 1   ==

.                 ranksum outcome1 if inlist(treatment, 1,2), by(treatment)

Two-sample Wilcoxon rank-sum (Mann–Whitney) test

   treatment |      Obs    Rank sum    Expected
-------------+---------------------------------
     Neutral |       16         248         264
    Converge |       16         280         264
-------------+---------------------------------
    Combined |       32         528         528

Unadjusted variance      704.00
Adjustment for ties       -6.58
                     ----------
Adjusted variance        697.42

H0: outcome1(treatm~t==Neutral) = outcome1(treatm~t==Converge)
         z = -0.606
Prob > |z| = 0.5446
Exact prob = 0.5560

.                 ranksum outcome1 if  inlist(treatment, 1,3), by(treatment)

Two-sample Wilcoxon rank-sum (Mann–Whitney) test

   treatment |      Obs    Rank sum    Expected
-------------+---------------------------------
     Neutral |       16         283         264
     Diverge |       16         245         264
-------------+---------------------------------
    Combined |       32         528         528

Unadjusted variance      704.00
Adjustment for ties       -2.71
                     ----------
Adjusted variance        701.29

H0: outcome1(treatm~t==Neutral) = outcome1(treatm~t==Diverge)
         z =  0.717
Prob > |z| = 0.4731
Exact prob = 0.4842

.                 ranksum outcome1 if  inlist(treatment, 1,4), by(treatment)

Two-sample Wilcoxon rank-sum (Mann–Whitney) test

   treatment |      Obs    Rank sum    Expected
-------------+---------------------------------
     Neutral |       16       265.5         264
    Neutral+ |       16       262.5         264
-------------+---------------------------------
    Combined |       32         528         528

Unadjusted variance      704.00
Adjustment for ties       -5.03
                     ----------
Adjusted variance        698.97

H0: outcome1(treatm~t==Neutral) = outcome1(treatm~t==Neutral+)
         z =  0.057
Prob > |z| = 0.9548
Exact prob = 0.9628

.                 ranksum outcome1 if  inlist(treatment, 2,3), by(treatment)

Two-sample Wilcoxon rank-sum (Mann–Whitney) test

   treatment |      Obs    Rank sum    Expected
-------------+---------------------------------
    Converge |       16         308         264
     Diverge |       16         220         264
-------------+---------------------------------
    Combined |       32         528         528

Unadjusted variance      704.00
Adjustment for ties       -6.32
                     ----------
Adjusted variance        697.68

H0: outcome1(treatm~t==Converge) = outcome1(treatm~t==Diverge)
         z =  1.666
Prob > |z| = 0.0958
Exact prob = 0.0980

.                 ranksum outcome1 if  inlist(treatment, 2,4), by(treatment)

Two-sample Wilcoxon rank-sum (Mann–Whitney) test

   treatment |      Obs    Rank sum    Expected
-------------+---------------------------------
    Converge |       16       277.5         264
    Neutral+ |       16       250.5         264
-------------+---------------------------------
    Combined |       32         528         528

Unadjusted variance      704.00
Adjustment for ties       -6.19
                     ----------
Adjusted variance        697.81

H0: outcome1(treatm~t==Converge) = outcome1(treatm~t==Neutral+)
         z =  0.511
Prob > |z| = 0.6093
Exact prob = 0.6206

.                 ranksum outcome1 if inlist(treatment, 3,4), by(treatment)

Two-sample Wilcoxon rank-sum (Mann–Whitney) test

   treatment |      Obs    Rank sum    Expected
-------------+---------------------------------
     Diverge |       16       243.5         264
    Neutral+ |       16       284.5         264
-------------+---------------------------------
    Combined |       32         528         528

Unadjusted variance      704.00
Adjustment for ties       -3.48
                     ----------
Adjusted variance        700.52

H0: outcome1(treatm~t==Diverge) = outcome1(treatm~t==Neutral+)
         z = -0.775
Prob > |z| = 0.4386
Exact prob = 0.4495

.                 ranksum outcome1 if inlist(treatment, 1,5), by(treatment)

Two-sample Wilcoxon rank-sum (Mann–Whitney) test

   treatment |      Obs    Rank sum    Expected
-------------+---------------------------------
     Neutral |       16         143         200
Neutral-Chat |        8         157         100
-------------+---------------------------------
    Combined |       24         300         300

Unadjusted variance      266.67
Adjustment for ties       -3.71
                     ----------
Adjusted variance        262.96

H0: outcome1(treatm~t==Neutral) = outcome1(treatm~t==Neutral-Chat)
         z = -3.515
Prob > |z| = 0.0004
Exact prob = 0.0001

. 
. restore

. 
. 
. *====================================================================================
. *       FIG SUPP. MATERIALS:  dynamic COOPERATION (PHASE 1)  --  1 obs= 1 mixed group in a period
. *====================================================================================
. use $data

. preserve

.         graph drop _all

.         drop if game==5
(18,384 observations deleted)

.         keep if treat<5
(8,136 observations deleted)

.                 
.         collapse outcome, by(treatment sessionID groupID groupsize period)

.         collapse outcome (sem) semc=outcome, by(treatment groupsize period)

.                 
.         sum period

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
      period |        224     14.5625    8.202353          1         30

.         local per_max=r(max)

. 
.         generate hi_sem = outcome + semc   

.         generate low_sem = outcome - semc

.         
.         graph twoway     (rarea hi_sem low_sem period if treat==1 , vertical  fin(inten30)  lwidth(none))       (scatter outcome period if treat==2 ,  msymbol(o) 
> connect(l ) lpattern(solid)  mc(black) lcolor(black) lw(medium))     (scatter outcome period if treat==3 ,   msymbol(sh) connect(l) lpattern(solid)  mc(black) lco
> lor(black) lw(medium) )   (scatter outcome period if treat==4 ,   msymbol(th) connect(l ) lpattern(dash)  mc(red) lcolor(red) lw(medium) )   ,                    
> ytitle("Cooperation Rate", size(medsmall))         yscale(range(0 1))   ylabel(0(.2)1.0, labs(medium) nogrid)    xlabel(1 5 10 15 20 25 `per_max',  labs(medium) n
> ogrid)   xtitle("Rounds", size(medium))   graphregion(color(white)fcolor(white)) plotregion(margin(zero)) legend(order(1 "Neutral"  2 "Converge"  3 "Diverge"  4 "
> Neutral+")  ring(0) pos(11) rows(1)  size(small) symxsize(*0.5))      xline(18, lp(dash))     scale(1.2)   by(groupsize, note(""))  

. 
.         graph export periods.eps, as(eps) preview(off) replace  
(file periods.eps not found)
file periods.eps saved as EPS format

. 
. restore

.         
.         
. *===========================================
. *       COOPERATION  in PHASE 2 (1 obs= 1 economy)
. *===========================================
. use $data 

. preserve

.         drop if game<5
(71,592 observations deleted)

.         tab partnership groupsize if period==1

      Group |
Configurati |           Economy Size
         on |         2         16         24 |     Total
------------+---------------------------------+----------
Mixed Group |         0        448        192 |       640 
 Fixed Pair |       224          0          0 |       224 
------------+---------------------------------+----------
      Total |       224        448        192 |       864 

.         collapse outcome , by(treatment sessionID groupID partnership)          

.         table (partnership) (treat) , statistic(mean  outcome)  statistic(sd outcome)   nformat(%9.3f) nototals

--------------------------------------------------------------------------------
                       |                         Treatment                      
                       |  Neutral   Converge   Diverge   Neutral+   Neutral-Chat
-----------------------+--------------------------------------------------------
Group Configuration    |                                                        
  Mixed Group          |                                                        
    Mean               |    0.381      0.340     0.305      0.329          0.754
    Standard deviation |    0.118      0.177     0.162      0.091          0.133
  Fixed Pair           |                                                        
    Mean               |    0.844      0.718     0.750      0.805          0.982
    Standard deviation |    0.312      0.416     0.362      0.343          0.035
--------------------------------------------------------------------------------

. restore

. 
.         
. *====================================================================================================
. *       COOPERATION  in PHASE 2 (1 obs= 1 session; Two-sided Wilcoxon-Mann Whitney ranksum test with exact statistics)
. *====================================================================================================
. preserve

.         keep if game==5
(71,592 observations deleted)

.         gen outcome1=outcome if period==1
(17,520 missing values generated)

.         collapse outcome outcome1, by(treatment sessionID partnership)

.                 
.         local partnership  "0 1"

.         foreach i of local partnership {
  2.                 dis "==       COOPERATION  in Phase 2:  Partnership  =" `i'  "     =="
  3.                 dis "********************************************** "
  4.                 ranksum outcome if partnership==`i' & inlist(treatment, 1,2), by(treatment)
  5.                 ranksum outcome if partnership==`i' & inlist(treatment, 1,3), by(treatment)
  6.                 ranksum outcome if partnership==`i' & inlist(treatment, 1,4), by(treatment)
  7.                 ranksum outcome if partnership==`i' & inlist(treatment, 2,3), by(treatment)
  8.                 ranksum outcome if partnership==`i' & inlist(treatment, 2,4), by(treatment)
  9.                 ranksum outcome if partnership==`i' & inlist(treatment, 3,4), by(treatment)
 10.                 ranksum outcome if partnership==`i' & inlist(treatment, 1,5), by(treatment)
 11.         }
==       COOPERATION  in Phase 2:  Partnership  =0     ==
********************************************** 

Two-sample Wilcoxon rank-sum (Mann–Whitney) test

   treatment |      Obs    Rank sum    Expected
-------------+---------------------------------
     Neutral |        8          79          68
    Converge |        8          57          68
-------------+---------------------------------
    Combined |       16         136         136

Unadjusted variance       90.67
Adjustment for ties        0.00
                     ----------
Adjusted variance         90.67

H0: outcome(treatm~t==Neutral) = outcome(treatm~t==Converge)
         z =  1.155
Prob > |z| = 0.2480
Exact prob = 0.2786

Two-sample Wilcoxon rank-sum (Mann–Whitney) test

   treatment |      Obs    Rank sum    Expected
-------------+---------------------------------
     Neutral |        8          81          68
     Diverge |        8          55          68
-------------+---------------------------------
    Combined |       16         136         136

Unadjusted variance       90.67
Adjustment for ties        0.00
                     ----------
Adjusted variance         90.67

H0: outcome(treatm~t==Neutral) = outcome(treatm~t==Diverge)
         z =  1.365
Prob > |z| = 0.1722
Exact prob = 0.1949

Two-sample Wilcoxon rank-sum (Mann–Whitney) test

   treatment |      Obs    Rank sum    Expected
-------------+---------------------------------
     Neutral |        8          77          68
    Neutral+ |        8          59          68
-------------+---------------------------------
    Combined |       16         136         136

Unadjusted variance       90.67
Adjustment for ties        0.00
                     ----------
Adjusted variance         90.67

H0: outcome(treatm~t==Neutral) = outcome(treatm~t==Neutral+)
         z =  0.945
Prob > |z| = 0.3446
Exact prob = 0.3823

Two-sample Wilcoxon rank-sum (Mann–Whitney) test

   treatment |      Obs    Rank sum    Expected
-------------+---------------------------------
    Converge |        8        74.5          68
     Diverge |        8        61.5          68
-------------+---------------------------------
    Combined |       16         136         136

Unadjusted variance       90.67
Adjustment for ties       -0.13
                     ----------
Adjusted variance         90.53

H0: outcome(treatm~t==Converge) = outcome(treatm~t==Diverge)
         z =  0.683
Prob > |z| = 0.4945
Exact prob = 0.5242

Two-sample Wilcoxon rank-sum (Mann–Whitney) test

   treatment |      Obs    Rank sum    Expected
-------------+---------------------------------
    Converge |        8          63          68
    Neutral+ |        8          73          68
-------------+---------------------------------
    Combined |       16         136         136

Unadjusted variance       90.67
Adjustment for ties        0.00
                     ----------
Adjusted variance         90.67

H0: outcome(treatm~t==Converge) = outcome(treatm~t==Neutral+)
         z = -0.525
Prob > |z| = 0.5995
Exact prob = 0.6454

Two-sample Wilcoxon rank-sum (Mann–Whitney) test

   treatment |      Obs    Rank sum    Expected
-------------+---------------------------------
     Diverge |        8          59          68
    Neutral+ |        8          77          68
-------------+---------------------------------
    Combined |       16         136         136

Unadjusted variance       90.67
Adjustment for ties        0.00
                     ----------
Adjusted variance         90.67

H0: outcome(treatm~t==Diverge) = outcome(treatm~t==Neutral+)
         z = -0.945
Prob > |z| = 0.3446
Exact prob = 0.3823

Two-sample Wilcoxon rank-sum (Mann–Whitney) test

   treatment |      Obs    Rank sum    Expected
-------------+---------------------------------
     Neutral |        8          36          52
Neutral-Chat |        4          42          26
-------------+---------------------------------
    Combined |       12          78          78

Unadjusted variance       34.67
Adjustment for ties        0.00
                     ----------
Adjusted variance         34.67

H0: outcome(treatm~t==Neutral) = outcome(treatm~t==Neutral-Chat)
         z = -2.717
Prob > |z| = 0.0066
Exact prob = 0.0040
==       COOPERATION  in Phase 2:  Partnership  =1     ==
********************************************** 

Two-sample Wilcoxon rank-sum (Mann–Whitney) test

   treatment |      Obs    Rank sum    Expected
-------------+---------------------------------
     Neutral |        8        65.5          60
    Converge |        6        39.5          45
-------------+---------------------------------
    Combined |       14         105         105

Unadjusted variance       60.00
Adjustment for ties       -0.66
                     ----------
Adjusted variance         59.34

H0: outcome(treatm~t==Neutral) = outcome(treatm~t==Converge)
         z =  0.714
Prob > |z| = 0.4752
Exact prob = 0.5082

Two-sample Wilcoxon rank-sum (Mann–Whitney) test

   treatment |      Obs    Rank sum    Expected
-------------+---------------------------------
     Neutral |        8        72.5          64
     Diverge |        7        47.5          56
-------------+---------------------------------
    Combined |       15         120         120

Unadjusted variance       74.67
Adjustment for ties       -0.27
                     ----------
Adjusted variance         74.40

H0: outcome(treatm~t==Neutral) = outcome(treatm~t==Diverge)
         z =  0.985
Prob > |z| = 0.3244
Exact prob = 0.3537

Two-sample Wilcoxon rank-sum (Mann–Whitney) test

   treatment |      Obs    Rank sum    Expected
-------------+---------------------------------
     Neutral |        8          58          56
    Neutral+ |        5          33          35
-------------+---------------------------------
    Combined |       13          91          91

Unadjusted variance       46.67
Adjustment for ties       -0.51
                     ----------
Adjusted variance         46.15

H0: outcome(treatm~t==Neutral) = outcome(treatm~t==Neutral+)
         z =  0.294
Prob > |z| = 0.7685
Exact prob = 0.8283

Two-sample Wilcoxon rank-sum (Mann–Whitney) test

   treatment |      Obs    Rank sum    Expected
-------------+---------------------------------
    Converge |        6        41.5          42
     Diverge |        7        49.5          49
-------------+---------------------------------
    Combined |       13          91          91

Unadjusted variance       49.00
Adjustment for ties       -0.13
                     ----------
Adjusted variance         48.87

H0: outcome(treatm~t==Converge) = outcome(treatm~t==Diverge)
         z = -0.072
Prob > |z| = 0.9430
Exact prob = 0.9779

Two-sample Wilcoxon rank-sum (Mann–Whitney) test

   treatment |      Obs    Rank sum    Expected
-------------+---------------------------------
    Converge |        6        34.5          36
    Neutral+ |        5        31.5          30
-------------+---------------------------------
    Combined |       11          66          66

Unadjusted variance       30.00
Adjustment for ties       -0.14
                     ----------
Adjusted variance         29.86

H0: outcome(treatm~t==Converge) = outcome(treatm~t==Neutral+)
         z = -0.274
Prob > |z| = 0.7837
Exact prob = 0.8398

Two-sample Wilcoxon rank-sum (Mann–Whitney) test

   treatment |      Obs    Rank sum    Expected
-------------+---------------------------------
     Diverge |        7          42        45.5
    Neutral+ |        5          36        32.5
-------------+---------------------------------
    Combined |       12          78          78

Unadjusted variance       37.92
Adjustment for ties        0.00
                     ----------
Adjusted variance         37.92

H0: outcome(treatm~t==Diverge) = outcome(treatm~t==Neutral+)
         z = -0.568
Prob > |z| = 0.5698
Exact prob = 0.6389

Two-sample Wilcoxon rank-sum (Mann–Whitney) test

   treatment |      Obs    Rank sum    Expected
-------------+---------------------------------
     Neutral |        8          40          44
Neutral-Chat |        2          15          11
-------------+---------------------------------
    Combined |       10          55          55

Unadjusted variance       14.67
Adjustment for ties       -0.36
                     ----------
Adjusted variance         14.31

H0: outcome(treatm~t==Neutral) = outcome(treatm~t==Neutral-Chat)
         z = -1.057
Prob > |z| = 0.2903
Exact prob = 0.4000

. 
.         local partnership  "0 1"

.         foreach i of local partnership {
  2.                 dis "==       COOPERATION  in Phase 2 in period 1:  Partnership  =" `i'  "     =="
  3.                 dis "********************************************** "
  4.                 ranksum outcome1 if partnership==`i' & inlist(treatment, 1,2), by(treatment)
  5.                 ranksum outcome1 if partnership==`i' & inlist(treatment, 1,3), by(treatment)
  6.                 ranksum outcome1 if partnership==`i' & inlist(treatment, 1,4), by(treatment)
  7.                 ranksum outcome1 if partnership==`i' & inlist(treatment, 2,3), by(treatment)
  8.                 ranksum outcome1 if partnership==`i' & inlist(treatment, 2,4), by(treatment)
  9.                 ranksum outcome1 if partnership==`i' & inlist(treatment, 3,4), by(treatment)
 10.                 ranksum outcome1 if partnership==`i' & inlist(treatment, 1,5), by(treatment)
 11.         }
==       COOPERATION  in Phase 2 in period 1:  Partnership  =0     ==
********************************************** 

Two-sample Wilcoxon rank-sum (Mann–Whitney) test

   treatment |      Obs    Rank sum    Expected
-------------+---------------------------------
     Neutral |        8        70.5          68
    Converge |        8        65.5          68
-------------+---------------------------------
    Combined |       16         136         136

Unadjusted variance       90.67
Adjustment for ties       -4.53
                     ----------
Adjusted variance         86.13

H0: outcome1(treatm~t==Neutral) = outcome1(treatm~t==Converge)
         z =  0.269
Prob > |z| = 0.7876
Exact prob = 0.7855

Two-sample Wilcoxon rank-sum (Mann–Whitney) test

   treatment |      Obs    Rank sum    Expected
-------------+---------------------------------
     Neutral |        8        70.5          68
     Diverge |        8        65.5          68
-------------+---------------------------------
    Combined |       16         136         136

Unadjusted variance       90.67
Adjustment for ties       -4.67
                     ----------
Adjusted variance         86.00

H0: outcome1(treatm~t==Neutral) = outcome1(treatm~t==Diverge)
         z =  0.270
Prob > |z| = 0.7875
Exact prob = 0.7927

Two-sample Wilcoxon rank-sum (Mann–Whitney) test

   treatment |      Obs    Rank sum    Expected
-------------+---------------------------------
     Neutral |        8          72          68
    Neutral+ |        8          64          68
-------------+---------------------------------
    Combined |       16         136         136

Unadjusted variance       90.67
Adjustment for ties       -3.87
                     ----------
Adjusted variance         86.80

H0: outcome1(treatm~t==Neutral) = outcome1(treatm~t==Neutral+)
         z =  0.429
Prob > |z| = 0.6677
Exact prob = 0.6976

Two-sample Wilcoxon rank-sum (Mann–Whitney) test

   treatment |      Obs    Rank sum    Expected
-------------+---------------------------------
    Converge |        8        69.5          68
     Diverge |        8        66.5          68
-------------+---------------------------------
    Combined |       16         136         136

Unadjusted variance       90.67
Adjustment for ties       -2.27
                     ----------
Adjusted variance         88.40

H0: outcome1(treatm~t==Converge) = outcome1(treatm~t==Diverge)
         z =  0.160
Prob > |z| = 0.8732
Exact prob = 0.9051

Two-sample Wilcoxon rank-sum (Mann–Whitney) test

   treatment |      Obs    Rank sum    Expected
-------------+---------------------------------
    Converge |        8        68.5          68
    Neutral+ |        8        67.5          68
-------------+---------------------------------
    Combined |       16         136         136

Unadjusted variance       90.67
Adjustment for ties       -1.20
                     ----------
Adjusted variance         89.47

H0: outcome1(treatm~t==Converge) = outcome1(treatm~t==Neutral+)
         z =  0.053
Prob > |z| = 0.9578
Exact prob = 0.9768

Two-sample Wilcoxon rank-sum (Mann–Whitney) test

   treatment |      Obs    Rank sum    Expected
-------------+---------------------------------
     Diverge |        8          68          68
    Neutral+ |        8          68          68
-------------+---------------------------------
    Combined |       16         136         136

Unadjusted variance       90.67
Adjustment for ties       -1.60
                     ----------
Adjusted variance         89.07

H0: outcome1(treatm~t==Diverge) = outcome1(treatm~t==Neutral+)
         z =  0.000
Prob > |z| = 1.0000
Exact prob = 1.0000

Two-sample Wilcoxon rank-sum (Mann–Whitney) test

   treatment |      Obs    Rank sum    Expected
-------------+---------------------------------
     Neutral |        8          36          52
Neutral-Chat |        4          42          26
-------------+---------------------------------
    Combined |       12          78          78

Unadjusted variance       34.67
Adjustment for ties       -1.09
                     ----------
Adjusted variance         33.58

H0: outcome1(treatm~t==Neutral) = outcome1(treatm~t==Neutral-Chat)
         z = -2.761
Prob > |z| = 0.0058
Exact prob = 0.0040
==       COOPERATION  in Phase 2 in period 1:  Partnership  =1     ==
********************************************** 

Two-sample Wilcoxon rank-sum (Mann–Whitney) test

   treatment |      Obs    Rank sum    Expected
-------------+---------------------------------
     Neutral |        8          64          60
    Converge |        6          41          45
-------------+---------------------------------
    Combined |       14         105         105

Unadjusted variance       60.00
Adjustment for ties      -10.02
                     ----------
Adjusted variance         49.98

H0: outcome1(treatm~t==Neutral) = outcome1(treatm~t==Converge)
         z =  0.566
Prob > |z| = 0.5715
Exact prob = 0.6387

Two-sample Wilcoxon rank-sum (Mann–Whitney) test

   treatment |      Obs    Rank sum    Expected
-------------+---------------------------------
     Neutral |        8          68          64
     Diverge |        7          52          56
-------------+---------------------------------
    Combined |       15         120         120

Unadjusted variance       74.67
Adjustment for ties      -14.93
                     ----------
Adjusted variance         59.73

H0: outcome1(treatm~t==Neutral) = outcome1(treatm~t==Diverge)
         z =  0.518
Prob > |z| = 0.6048
Exact prob = 0.8096

Two-sample Wilcoxon rank-sum (Mann–Whitney) test

   treatment |      Obs    Rank sum    Expected
-------------+---------------------------------
     Neutral |        8          60          56
    Neutral+ |        5          31          35
-------------+---------------------------------
    Combined |       13          91          91

Unadjusted variance       46.67
Adjustment for ties       -8.97
                     ----------
Adjusted variance         37.69

H0: outcome1(treatm~t==Neutral) = outcome1(treatm~t==Neutral+)
         z =  0.652
Prob > |z| = 0.5147
Exact prob = 0.7086

Two-sample Wilcoxon rank-sum (Mann–Whitney) test

   treatment |      Obs    Rank sum    Expected
-------------+---------------------------------
    Converge |        6        40.5          42
     Diverge |        7        50.5          49
-------------+---------------------------------
    Combined |       13          91          91

Unadjusted variance       49.00
Adjustment for ties       -6.19
                     ----------
Adjusted variance         42.81

H0: outcome1(treatm~t==Converge) = outcome1(treatm~t==Diverge)
         z = -0.229
Prob > |z| = 0.8187
Exact prob = 0.9592

Two-sample Wilcoxon rank-sum (Mann–Whitney) test

   treatment |      Obs    Rank sum    Expected
-------------+---------------------------------
    Converge |        6        35.5          36
    Neutral+ |        5        30.5          30
-------------+---------------------------------
    Combined |       11          66          66

Unadjusted variance       30.00
Adjustment for ties       -3.41
                     ----------
Adjusted variance         26.59

H0: outcome1(treatm~t==Converge) = outcome1(treatm~t==Neutral+)
         z = -0.097
Prob > |z| = 0.9228
Exact prob = 1.0000

Two-sample Wilcoxon rank-sum (Mann–Whitney) test

   treatment |      Obs    Rank sum    Expected
-------------+---------------------------------
     Diverge |        7        46.5        45.5
    Neutral+ |        5        31.5        32.5
-------------+---------------------------------
    Combined |       12          78          78

Unadjusted variance       37.92
Adjustment for ties       -5.44
                     ----------
Adjusted variance         32.48

H0: outcome1(treatm~t==Diverge) = outcome1(treatm~t==Neutral+)
         z =  0.175
Prob > |z| = 0.8607
Exact prob = 1.0000

Two-sample Wilcoxon rank-sum (Mann–Whitney) test

   treatment |      Obs    Rank sum    Expected
-------------+---------------------------------
     Neutral |        8          44          44
Neutral-Chat |        2          11          11
-------------+---------------------------------
    Combined |       10          55          55

Unadjusted variance       14.67
Adjustment for ties       -3.56
                     ----------
Adjusted variance         11.11

H0: outcome1(treatm~t==Neutral) = outcome1(treatm~t==Neutral-Chat)
         z =  0.000
Prob > |z| = 1.0000
Exact prob = 1.0000

. 
. restore

. 
.         
.         
. *======================================================================================
. *       COOPERATION  in MIXED GROUPS (PHASE 1  & PHASE 2 separately)    Unit of obs = Economy 
. *======================================================================================
. use $data 

. preserve

.         keep if groupsize>2     
(40,192 observations deleted)

.         keep if treat <5
(5,312 observations deleted)

.         
.         macro define controls "sex duration response_t wrong_ans"               

.         collapse outcome   $controls, by (treatment sessionID game  groupID order )

.         center response_t wrong_ans duration, inplace  standardize 
(modified variables: response_t wrong_ans duration)

.         gen game2=(game==2 | game==4)

. 
. *** GLM regression      
.         est clear

.         glm  outcome   i.treat    i.game2   i.order  $controls if game<5, cluster(sessionID) link(logit) family(binomial) robust nolog 
note: outcome has noninteger values

Generalized linear models                         Number of obs   =        128
Optimization     : ML                             Residual df     =        118
                                                  Scale parameter =          1
Deviance         =  17.06565121                   (1/df) Deviance =   .1446242
Pearson          =   16.1425243                   (1/df) Pearson  =   .1368011

Variance function: V(u) = u*(1-u/1)               [Binomial]
Link function    : g(u) = ln(u/(1-u))             [Logit]

                                                  AIC             =   1.072095
Log pseudolikelihood = -58.61409943               BIC             =  -555.4739

                             (Std. err. adjusted for 32 clusters in sessionID)
------------------------------------------------------------------------------
             |               Robust
     outcome | Coefficient  std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
   treatment |
   Converge  |  -.0362551   .2120353    -0.17   0.864    -.4518368    .3793265
    Diverge  |  -.1999645   .2826991    -0.71   0.479    -.7540446    .3541156
   Neutral+  |   .2078409   .2187669     0.95   0.342    -.2209344    .6366162
             |
     1.game2 |  -.0771235   .0861765    -0.89   0.371    -.2460265    .0917794
             |
       order |
large first  |  -.5418426   .1599686    -3.39   0.001    -.8553754   -.2283098
         sex |   .4778072   .3713685     1.29   0.198    -.2500617    1.205676
    duration |  -.0042972    .055008    -0.08   0.938    -.1121108    .1035165
  response_t |   .0576763   .0874186     0.66   0.509     -.113661    .2290137
   wrong_ans |  -.0832802   .0914937    -0.91   0.363    -.2626046    .0960441
       _cons |  -.3815251   .2459429    -1.55   0.121    -.8635644    .1005141
------------------------------------------------------------------------------

.         margins, dydx(*) at((base) _factor (asobs) $controls ) post

Average marginal effects                                   Number of obs = 128
Model VCE: Robust

Expression: Predicted mean outcome, predict()
dy/dx wrt:  2.treatment 3.treatment 4.treatment 1.game2 1.order sex duration response_t wrong_ans
At: treatment = 1
    game2     = 0
    order     = 0

------------------------------------------------------------------------------
             |            Delta-method
             |      dy/dx   std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
   treatment |
   Converge  |  -.0089482    .052319    -0.17   0.864    -.1114916    .0935951
    Diverge  |  -.0488627   .0686811    -0.71   0.477    -.1834751    .0857497
   Neutral+  |   .0516495   .0541469     0.95   0.340    -.0544765    .1577755
             |
     1.game2 |  -.0189953   .0212243    -0.89   0.371    -.0605941    .0226036
             |
       order |
large first  |  -.1279563   .0378501    -3.38   0.001     -.202141   -.0537715
         sex |   .1181216    .091608     1.29   0.197    -.0614267    .2976699
    duration |  -.0010623   .0135984    -0.08   0.938    -.0277147      .02559
  response_t |   .0142585   .0215791     0.66   0.509    -.0280357    .0565527
   wrong_ans |  -.0205882   .0224584    -0.92   0.359    -.0646059    .0234295
------------------------------------------------------------------------------
Note: dy/dx for factor levels is the discrete change from the base level.

.         test 2.treatment=3.treatment

 ( 1)  2.treatment - 3.treatment = 0

           chi2(  1) =    0.33
         Prob > chi2 =    0.5648

.         test 2.treatment=4.treatment

 ( 1)  2.treatment - 4.treatment = 0

           chi2(  1) =    1.40
         Prob > chi2 =    0.2365

.         test 3.treatment=4.treatment

 ( 1)  3.treatment - 4.treatment = 0

           chi2(  1) =    2.92
         Prob > chi2 =    0.0875

.         eststo reg1

. 
.         glm  outcome   i.treat    i.order $controls if game==5, cluster(sessionID) link(logit) family(binomial) robust nolog 
note: outcome has noninteger values

Generalized linear models                         Number of obs   =         32
Optimization     : ML                             Residual df     =         23
                                                  Scale parameter =          1
Deviance         =  1.802392036                   (1/df) Deviance =   .0783649
Pearson          =  1.773757948                   (1/df) Pearson  =   .0771199

Variance function: V(u) = u*(1-u/1)               [Binomial]
Link function    : g(u) = ln(u/(1-u))             [Logit]

                                                  AIC             =   1.417053
Log pseudolikelihood = -13.67285236               BIC             =  -77.90953

                             (Std. err. adjusted for 32 clusters in sessionID)
------------------------------------------------------------------------------
             |               Robust
     outcome | Coefficient  std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
   treatment |
   Converge  |   -.246982   .2769089    -0.89   0.372    -.7897134    .2957494
    Diverge  |  -.2053345   .2968405    -0.69   0.489    -.7871311    .3764621
   Neutral+  |   .1753344   .3249096     0.54   0.589    -.4614767    .8121454
             |
       order |
large first  |    .125589   .1649281     0.76   0.446    -.1976642    .4488422
         sex |  -.5108793   .6674325    -0.77   0.444    -1.819023    .7972645
    duration |  -.3007225   .0603122    -4.99   0.000    -.4189322   -.1825128
  response_t |   .0173982   .1053033     0.17   0.869    -.1889926    .2237889
   wrong_ans |  -.1874545   .1294513    -1.45   0.148    -.4411743    .0662653
       _cons |  -.4299203   .3757653    -1.14   0.253    -1.166407    .3065663
------------------------------------------------------------------------------

.         margins, dydx(*) at((base) _factor (asobs) $controls ) post

Average marginal effects                                    Number of obs = 32
Model VCE: Robust

Expression: Predicted mean outcome, predict()
dy/dx wrt:  2.treatment 3.treatment 4.treatment 1.order sex duration response_t wrong_ans
At: treatment = 1
    order     = 0

------------------------------------------------------------------------------
             |            Delta-method
             |      dy/dx   std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
   treatment |
   Converge  |  -.0518482   .0589781    -0.88   0.379    -.1674431    .0637468
    Diverge  |  -.0434262   .0637198    -0.68   0.496    -.1683148    .0814624
   Neutral+  |   .0392726   .0721542     0.54   0.586     -.102147    .1806923
             |
       order |
large first  |   .0279515   .0361615     0.77   0.440    -.0429237    .0988267
         sex |   -.111714   .1460513    -0.76   0.444    -.3979692    .1745412
    duration |   -.065759   .0105391    -6.24   0.000    -.0864152   -.0451028
  response_t |   .0038045   .0230607     0.16   0.869    -.0413937    .0490026
   wrong_ans |  -.0409907   .0269884    -1.52   0.129    -.0938869    .0119055
------------------------------------------------------------------------------
Note: dy/dx for factor levels is the discrete change from the base level.

.         test 2.treatment=3.treatment

 ( 1)  2.treatment - 3.treatment = 0

           chi2(  1) =    0.02
         Prob > chi2 =    0.8822

.         test 2.treatment=4.treatment

 ( 1)  2.treatment - 4.treatment = 0

           chi2(  1) =    1.95
         Prob > chi2 =    0.1629

.         test 3.treatment=4.treatment

 ( 1)  3.treatment - 4.treatment = 0

           chi2(  1) =    2.72
         Prob > chi2 =    0.0992

.         eststo reg2

. 
.         estout * using output0.tex,  replace cells(b(star fmt(3)) se(par fmt(3))) style(tex) label varlabels(1.order "Order 12-12-2-2"  1.game2 "$2^{nd}$ Supergam
> e" duration "Duration" wrong_ans "Incorrect Answers" _cons Constant response_t "Response Time"   1.sex "Male"  sex "Male") collabels(,none) stats(N, labels("N") f
> mt(0 3)) prefoot(\hline) starlevels(* 0.10 ** 0.05 *** 0.01) posthead(\hline) margin(p) nobaselevel
(file output0.tex not found)
(output written to output0.tex)

. 
. restore

. 
. ***==           NEUTRAL-CHAT vs NEUTRAL         ==***
. preserve

.         keep if inlist(treat,1,5) & order==0
(70,272 observations deleted)

.         keep if groupsize>2     
(9,248 observations deleted)

.         
.         table (treat) (game) , statistic(mean  outcome)  nformat(%9.3f) totals(treat)

-----------------------------------------------
               |            Supergame          
               |      3       4       5   Total
---------------+-------------------------------
Treatment      |                               
  Neutral      |  0.542   0.488   0.399   0.486
  Neutral-Chat |  0.953   0.923   0.749   0.884
-----------------------------------------------

.         
.         table (treat) (game) if game<5, statistic(mean  outcome)  nformat(%9.3f) totals(treat)

---------------------------------------
               |        Supergame      
               |      3       4   Total
---------------+-----------------------
Treatment      |                       
  Neutral      |  0.542   0.488   0.516
  Neutral-Chat |  0.953   0.923   0.939
---------------------------------------

.                 
.         macro define controls "sex duration response_t wrong_ans"               

.         collapse outcome   $controls, by (treatment sessionID game  groupID)

.         center response_t wrong_ans duration, inplace  standardize 
(modified variables: response_t wrong_ans duration)

.         gen game2=(game==2 | game==4)

. 
. *** GLM regression      
.         est clear

.         glm  outcome   i.treat    i.game2    $controls if game<5, cluster(sessionID) link(logit) family(binomial) robust nolog 
note: outcome has noninteger values

Generalized linear models                         Number of obs   =         32
Optimization     : ML                             Residual df     =         25
                                                  Scale parameter =          1
Deviance         =  3.658993616                   (1/df) Deviance =   .1463597
Pearson          =  3.258615694                   (1/df) Pearson  =   .1303446

Variance function: V(u) = u*(1-u/1)               [Binomial]
Link function    : g(u) = ln(u/(1-u))             [Logit]

                                                  AIC             =   1.089754
Log pseudolikelihood = -10.43606462               BIC             =   -82.9844

                               (Std. err. adjusted for 8 clusters in sessionID)
-------------------------------------------------------------------------------
              |               Robust
      outcome | Coefficient  std. err.      z    P>|z|     [95% conf. interval]
--------------+----------------------------------------------------------------
    treatment |
Neutral-Chat  |   2.704916   .3906408     6.92   0.000     1.939274    3.470558
      1.game2 |  -.1765456   .1386236    -1.27   0.203    -.4482429    .0951517
          sex |   .9190773    1.47055     0.62   0.532    -1.963147    3.801302
     duration |   .0720137   .0838706     0.86   0.391    -.0923697    .2363971
   response_t |   .2244103   .3046438     0.74   0.461    -.3726806    .8215011
    wrong_ans |   .1766282   .1789435     0.99   0.324    -.1740946     .527351
        _cons |  -.2444576   .7286553    -0.34   0.737    -1.672596    1.183681
-------------------------------------------------------------------------------

.         margins, dydx(*) at((base) _factor (asobs) $controls ) post

Average marginal effects                                    Number of obs = 32
Model VCE: Robust

Expression: Predicted mean outcome, predict()
dy/dx wrt:  5.treatment 1.game2 sex duration response_t wrong_ans
At: treatment = 1
    game2     = 0

-------------------------------------------------------------------------------
              |            Delta-method
              |      dy/dx   std. err.      z    P>|z|     [95% conf. interval]
--------------+----------------------------------------------------------------
    treatment |
Neutral-Chat  |   .4099156   .0573177     7.15   0.000      .297575    .5222563
      1.game2 |  -.0431612   .0349237    -1.24   0.217    -.1116105     .025288
          sex |   .2240042   .3578176     0.63   0.531    -.4773053    .9253138
     duration |   .0175517   .0209648     0.84   0.402    -.0235385    .0586419
   response_t |   .0546949    .072306     0.76   0.449    -.0870223    .1964121
    wrong_ans |   .0430491   .0419983     1.03   0.305     -.039266    .1253642
-------------------------------------------------------------------------------
Note: dy/dx for factor levels is the discrete change from the base level.

.         eststo reg1

. 
.         glm  outcome   i.treat   $controls if game==5, cluster(sessionID) link(logit) family(binomial) robust nolog 
note: outcome has noninteger values

Generalized linear models                         Number of obs   =          8
Optimization     : ML                             Residual df     =          2
                                                  Scale parameter =          1
Deviance         =  .0471300326                   (1/df) Deviance =    .023565
Pearson          =  .0475915949                   (1/df) Pearson  =   .0237958

Variance function: V(u) = u*(1-u/1)               [Binomial]
Link function    : g(u) = ln(u/(1-u))             [Logit]

                                                  AIC             =   2.280933
Log pseudolikelihood = -3.123732505               BIC             =  -4.111753

                               (Std. err. adjusted for 8 clusters in sessionID)
-------------------------------------------------------------------------------
              |               Robust
      outcome | Coefficient  std. err.      z    P>|z|     [95% conf. interval]
--------------+----------------------------------------------------------------
    treatment |
Neutral-Chat  |    1.91788   .1449112    13.23   0.000     1.633859    2.201901
          sex |   4.189852   .7083489     5.91   0.000     2.801514    5.578191
     duration |  -.0235354   .1665377    -0.14   0.888    -.3499432    .3028724
   response_t |   .6414965   .0646228     9.93   0.000     .5148381    .7681549
    wrong_ans |   .8304769   .0894463     9.28   0.000     .6551654    1.005788
        _cons |  -2.576303    .372517    -6.92   0.000    -3.306423   -1.846184
-------------------------------------------------------------------------------

.         margins, dydx(*) at((base) _factor (asobs) $controls ) post

Average marginal effects                                     Number of obs = 8
Model VCE: Robust

Expression: Predicted mean outcome, predict()
dy/dx wrt:  5.treatment sex duration response_t wrong_ans
At: treatment = 1

-------------------------------------------------------------------------------
              |            Delta-method
              |      dy/dx   std. err.      z    P>|z|     [95% conf. interval]
--------------+----------------------------------------------------------------
    treatment |
Neutral-Chat  |   .4021775   .0267758    15.02   0.000     .3496978    .4546572
          sex |   .8921628   .1363103     6.55   0.000     .6249995    1.159326
     duration |  -.0050115   .0354366    -0.14   0.888     -.074466    .0644431
   response_t |   .1365965   .0125734    10.86   0.000     .1119532    .1612399
    wrong_ans |   .1768369   .0202475     8.73   0.000     .1371525    .2165213
-------------------------------------------------------------------------------
Note: dy/dx for factor levels is the discrete change from the base level.

.         eststo reg2

. 
.         estout * using output1.tex,  replace cells(b(star fmt(3)) se(par fmt(3))) style(tex) label varlabels(1.order "Order 12-12-2-2"  1.game2 "$2^{nd}$ Supergam
> e" duration "Duration" wrong_ans "Incorrect Answers" _cons Constant response_t "Response Time"   1.sex "Male"  sex "Male") collabels(,none) stats(N, labels("N") f
> mt(0 3)) prefoot(\hline) starlevels(* 0.10 ** 0.05 *** 0.01) posthead(\hline) margin(p) nobaselevel
(file output1.tex not found)
(output written to output1.tex)

.                 
. restore

. 
. 
. *============================================
. *       LOGIT:  round 1 of mixed groups (PHASE 1)
. * ============================================
. use $data

. preserve

.         keep if treat<5
(10,008 observations deleted)

.         drop if type==0
(39,984 observations deleted)

. 
. **      Subjects in order=1 start with large and observe 0 Full C in fixed pairs
.         replace fullc=0 if order==1
(13,586 real changes made)

. 
.         keep if period==1 & groupsize>=12
(38,936 observations deleted)

.         macro define controls "sex response_t wrong_ans"                

. 
.         collapse choice   fullc  $controls, by(treatment sessionID game order groupID ID)

.         center response_t wrong_ans, inplace  standardize 
(modified variables: response_t wrong_ans)

.         gen game2=(game==2 | game==4)

. 
. *** LOGIT
.         est clear       

.         xtset ID game

Panel variable: ID (unbalanced)
 Time variable: game, 1 to 5, but with gaps
         Delta: 1 unit

.         
.         tab choice game if treat==1

    (mean) |                       Supergame
    choice |         1          2          3          4          5 |     Total
-----------+-------------------------------------------------------+----------
         0 |        39         33         15         16         24 |       127 
         1 |         9         15         33         32         40 |       129 
-----------+-------------------------------------------------------+----------
     Total |        48         48         48         48         64 |       256 

.         tab choice game if treat==2

    (mean) |                       Supergame
    choice |         1          2          3          4          5 |     Total
-----------+-------------------------------------------------------+----------
         0 |        30         22         13         12         30 |       107 
         1 |        18         26         35         36         42 |       157 
-----------+-------------------------------------------------------+----------
     Total |        48         48         48         48         72 |       264 

.         tab choice game if treat==3

    (mean) |                       Supergame
    choice |         1          2          3          4          5 |     Total
-----------+-------------------------------------------------------+----------
         0 |        39         24         20         24         29 |       136 
         1 |         9         24         28         24         39 |       124 
-----------+-------------------------------------------------------+----------
     Total |        48         48         48         48         68 |       260 

.                 
.         xtlogit choice i.treat i.fullc  i.order i.game2  $controls, re vce(cluster session)

Fitting comparison model:

Iteration 0:   log pseudolikelihood = -723.94301  
Iteration 1:   log pseudolikelihood =  -644.6067  
Iteration 2:   log pseudolikelihood = -644.28082  
Iteration 3:   log pseudolikelihood =  -644.2807  
Iteration 4:   log pseudolikelihood =  -644.2807  

Fitting full model:

tau =  0.0     log pseudolikelihood =  -644.2807
tau =  0.1     log pseudolikelihood =  -637.3845
tau =  0.2     log pseudolikelihood =  -630.4871
tau =  0.3     log pseudolikelihood = -623.67117
tau =  0.4     log pseudolikelihood = -617.06545
tau =  0.5     log pseudolikelihood = -610.88645
tau =  0.6     log pseudolikelihood = -605.53847
tau =  0.7     log pseudolikelihood = -601.88854
tau =  0.8     log pseudolikelihood = -602.24302

Iteration 0:   log pseudolikelihood = -601.88671  
Iteration 1:   log pseudolikelihood = -594.51961  
Iteration 2:   log pseudolikelihood = -594.49926  
Iteration 3:   log pseudolikelihood = -594.49926  

Calculating robust standard errors ...

Random-effects logistic regression                   Number of obs    =  1,048
Group variable: ID                                   Number of groups =    420

Random effects u_i ~ Gaussian                        Obs per group:
                                                                  min =      1
                                                                  avg =    2.5
                                                                  max =      3

Integration method: mvaghermite                      Integration pts. =     12

                                                     Wald chi2(10)    =  68.64
Log pseudolikelihood = -594.49926                    Prob > chi2      = 0.0000

                             (Std. err. adjusted for 32 clusters in sessionID)
------------------------------------------------------------------------------
             |               Robust
      choice | Coefficient  std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
   treatment |
   Converge  |   .2885853   .4181305     0.69   0.490    -.5309353    1.108106
    Diverge  |  -.0849145   .4924595    -0.17   0.863    -1.050117    .8802885
   Neutral+  |   .5802568   .3563569     1.63   0.103    -.1181899    1.278703
             |
       fullc |
          1  |   2.050278   .3355305     6.11   0.000      1.39265    2.707906
          2  |   2.392314    .764863     3.13   0.002     .8932105    3.891418
             |
       order |
large first  |  -.6962261    .409259    -1.70   0.089    -1.498359    .1059068
     1.game2 |   .2832669   .1793092     1.58   0.114    -.0681727    .6347065
         sex |   .3591287   .2930287     1.23   0.220    -.2151971    .9334544
  response_t |  -.0780948   .1431238    -0.55   0.585    -.3586122    .2024227
   wrong_ans |  -.4314914   .1341335    -3.22   0.001    -.6943882   -.1685945
       _cons |  -.5059937    .369626    -1.37   0.171    -1.230447      .21846
-------------+----------------------------------------------------------------
    /lnsig2u |   1.360704   .2544193                      .8620508    1.859356
-------------+----------------------------------------------------------------
     sigma_u |   1.974572   .2511847                      1.538835    2.533694
         rho |   .5423622   .0631483                      .4185334    .6611692
------------------------------------------------------------------------------

.         margins, dydx(*) at((base) _factor (asobs) $controls) post

Average marginal effects                                 Number of obs = 1,048
Model VCE: Robust

Expression: Pr(choice=1), predict(pr)
dy/dx wrt:  2.treatment 3.treatment 4.treatment 1.fullc 2.fullc 1.order 1.game2 sex response_t wrong_ans
At: treatment = 1
    fullc     = 0
    order     = 0
    game2     = 0

------------------------------------------------------------------------------
             |            Delta-method
             |      dy/dx   std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
   treatment |
   Converge  |   .0431262   .0621189     0.69   0.488    -.0786248    .1648771
    Diverge  |   -.012598   .0729059    -0.17   0.863     -.155491     .130295
   Neutral+  |   .0868067   .0517841     1.68   0.094    -.0146882    .1883017
             |
       fullc |
          1  |   .2902404    .043863     6.62   0.000     .2042706    .3762102
          2  |   .3298291   .0886426     3.72   0.000     .1560928    .5035655
             |
       order |
large first  |  -.1006245   .0574347    -1.75   0.080    -.2131944    .0119455
     1.game2 |    .042329   .0262904     1.61   0.107    -.0091993    .0938573
         sex |   .0533994   .0429265     1.24   0.214     -.030735    .1375339
  response_t |   -.011612   .0213735    -0.54   0.587    -.0535034    .0302793
   wrong_ans |  -.0641592   .0200699    -3.20   0.001    -.1034955   -.0248229
------------------------------------------------------------------------------
Note: dy/dx for factor levels is the discrete change from the base level.

.         test 2.treatment=3.treatment

 ( 1)  2.treatment - 3.treatment = 0

           chi2(  1) =    0.48
         Prob > chi2 =    0.4871

.         test 2.treatment=4.treatment

 ( 1)  2.treatment - 4.treatment = 0

           chi2(  1) =    0.45
         Prob > chi2 =    0.5016

.         test 3.treatment=4.treatment

 ( 1)  3.treatment - 4.treatment = 0

           chi2(  1) =    1.66
         Prob > chi2 =    0.1978

.         eststo reg1

. 
.         estout *  using output2.tex,  replace cells("b(star fmt(3)) se(par fmt(3))") style(tex) label varlabels(1.order "Order 12-12-2-2"  1.game2 "$2^{nd}$ Super
> game" duration "Duration" wrong_ans "Incorrect Answers" _cons Constant response_t "Response Time"   1.sex "Male"  sex "Male") collabels(,none) stats(N, labels("N"
> ) fmt(0 3)) prefoot(\hline) starlevels(* 0.10 ** 0.05 *** 0.01) posthead(\hline) margin(p) nobaselevel
(file output2.tex not found)
(output written to output2.tex)

. 
. restore

. 
. 
. *==========================================================================================================
. *       POWER TESTS --- COOPERATION  in MIXED GROUPS   (1 obs = 1 ECONOMY)
. *       Minimum detectable effect size on cooperation. Total sample size = 32 x 2 mixed groups (control + treatment, balanced sample). 
. *==========================================================================================================
. use $data 

. preserve

.         keep if treat<5
(10,008 observations deleted)

.         keep if groupsize==12
(47,544 observations deleted)

. 
.         collapse outcome profit, by (treatment sessionID groupID)

.         table (treat) () , statistic(mean outcome)  statistic(sd outcome) nformat(%9.3f)

----------------------------------------
           |   Mean   Standard deviation
-----------+----------------------------
Treatment  |                            
  Neutral  |  0.397                0.198
  Converge |  0.384                0.185
  Diverge  |  0.333                0.176
  Neutral+ |  0.421                0.192
  Total    |  0.384                0.189
----------------------------------------

.         table (treat) () , statistic(mean profit)  nformat(%9.3f)

-------------------
           |   Mean
-----------+-------
Treatment  |       
  Neutral  |  5.878
  Converge |  5.843
  Diverge  |  5.671
  Neutral+ |  6.396
  Total    |  5.947
-------------------

.         
.         tabout treatment using output3.tex, replace sum c(mean outcome  sd outcome) f(3) style(tex) bt font(bold) h1(nil) h2(nil) h3(nil) lines(none)

Table output written to: output3.tex

Neutral&0.397&0.198 \\
Converge&0.384&0.185 \\
Diverge&0.333&0.176 \\
Neutral+&0.421&0.192 \\
\textbf{Total}&0.384&0.189 \\

. 
. *       Calculate the mean & N obs. for alternative hypothesis H1 (pre-treatment)
.         tabstat outcome if treatment==1, stat(mean sd count) format(%9.3f) save

    Variable |      Mean        SD         N
-------------+------------------------------
     outcome |     0.397     0.198    32.000
--------------------------------------------

.         matrix A=r(StatTotal)

.         local mean_alt=A[1,1]

.         local sd1_alt=A[2,1]

. 
.         ** One sided tests
.         ** Converge
.         power twomeans `mean_alt', sd1(`sd1_alt')  sd2(0.185)  power(0.8 0.9)  alpha(0.1) n(64) direction(upper) onesided

Performing iteration ...

Estimated experimental-group mean for a two-sample means test
Satterthwaite's t test assuming unequal variances
H0: m2 = m1  versus  Ha: m2 > m1

  +---------------------------------------------------------------------------------+
  |   alpha   power       N      N1      N2   delta      m1      m2     sd1     sd2 |
  |---------------------------------------------------------------------------------|
  |      .1      .8      64      32      32   .1024   .3966    .499   .1982    .185 |
  |      .1      .9      64      32      32   .1237   .3966   .5203   .1982    .185 |
  +---------------------------------------------------------------------------------+

.         ** Diverge
.         power twomeans `mean_alt', sd1(`sd1_alt')  sd2(0.176)  power(0.8 0.9)  alpha(0.1) n(64) direction(lower) onesided

Performing iteration ...

Estimated experimental-group mean for a two-sample means test
Satterthwaite's t test assuming unequal variances
H0: m2 = m1  versus  Ha: m2 < m1

  +---------------------------------------------------------------------------------+
  |   alpha   power       N      N1      N2   delta      m1      m2     sd1     sd2 |
  |---------------------------------------------------------------------------------|
  |      .1      .8      64      32      32  -.1002   .3966   .2964   .1982    .176 |
  |      .1      .9      64      32      32  -.1209   .3966   .2757   .1982    .176 |
  +---------------------------------------------------------------------------------+

.         ** Neutral+
.         power twomeans `mean_alt', sd1(`sd1_alt')  sd2(0.192)  power(0.8 0.9)  alpha(0.1) n(64) direction(upper) onesided

Performing iteration ...

Estimated experimental-group mean for a two-sample means test
Satterthwaite's t test assuming unequal variances
H0: m2 = m1  versus  Ha: m2 > m1

  +---------------------------------------------------------------------------------+
  |   alpha   power       N      N1      N2   delta      m1      m2     sd1     sd2 |
  |---------------------------------------------------------------------------------|
  |      .1      .8      64      32      32   .1043   .3966   .5009   .1982    .192 |
  |      .1      .9      64      32      32   .1259   .3966   .5225   .1982    .192 |
  +---------------------------------------------------------------------------------+

. 
. 
.         ** Two sided tests
.         ** Converge
.         power twomeans `mean_alt', sd1(`sd1_alt')  sd2(0.185)  power(0.8 0.9)  alpha(0.1) n(64) 

Performing iteration ...

Estimated experimental-group mean for a two-sample means test
Satterthwaite's t test assuming unequal variances
H0: m2 = m1  versus  Ha: m2 != m1; m2 > m1

  +---------------------------------------------------------------------------------+
  |   alpha   power       N      N1      N2   delta      m1      m2     sd1     sd2 |
  |---------------------------------------------------------------------------------|
  |      .1      .8      64      32      32   .1205   .3966   .5171   .1982    .185 |
  |      .1      .9      64      32      32   .1418   .3966   .5384   .1982    .185 |
  +---------------------------------------------------------------------------------+

.         ** Diverge
.         power twomeans `mean_alt', sd1(`sd1_alt')  sd2(0.176)  power(0.8 0.9)  alpha(0.1) n(64) 

Performing iteration ...

Estimated experimental-group mean for a two-sample means test
Satterthwaite's t test assuming unequal variances
H0: m2 = m1  versus  Ha: m2 != m1; m2 > m1

  +---------------------------------------------------------------------------------+
  |   alpha   power       N      N1      N2   delta      m1      m2     sd1     sd2 |
  |---------------------------------------------------------------------------------|
  |      .1      .8      64      32      32   .1178   .3966   .5144   .1982    .176 |
  |      .1      .9      64      32      32   .1387   .3966   .5353   .1982    .176 |
  +---------------------------------------------------------------------------------+

.         ** Neutral+
.         power twomeans `mean_alt', sd1(`sd1_alt')  sd2(0.192)  power(0.8 0.9)  alpha(0.1) n(64) 

Performing iteration ...

Estimated experimental-group mean for a two-sample means test
Satterthwaite's t test assuming unequal variances
H0: m2 = m1  versus  Ha: m2 != m1; m2 > m1

  +---------------------------------------------------------------------------------+
  |   alpha   power       N      N1      N2   delta      m1      m2     sd1     sd2 |
  |---------------------------------------------------------------------------------|
  |      .1      .8      64      32      32   .1226   .3966   .5192   .1982    .192 |
  |      .1      .9      64      32      32   .1443   .3966   .5409   .1982    .192 |
  +---------------------------------------------------------------------------------+

. 
. restore

. 
. 
. *=================================
. *       FIG 2: COOPERATION  (PHASE 1)
. *=================================
. use $data

. preserve

.         graph drop _all

.         keep if treat<5
(10,008 observations deleted)

.         keep if groupsize==12
(47,544 observations deleted)

.         keep if type==1
(16,212 observations deleted)

. 
.         collapse choice, by(treatment sessionID country  groupID  game)

.                 bysort treat session groupID: egen mC=mean(choice)

.         collapse  coop=choice   mC   (sd)  sdcoop=choice  (count) n=choice  ,   by(treatment country)

. 
.         table (treat) (country), statistic(mean  coop)  nformat(%9.3f) totals(treat)

-----------------------------------------------
           |               Country             
           |  Disadv.   Middle   Advan.   Total
-----------+-----------------------------------
Treatment  |                                   
  Neutral  |    0.376    0.390    0.424   0.397
  Converge |    0.394    0.352    0.406   0.384
  Diverge  |    0.307    0.296    0.396   0.333
  Neutral+ |    0.391    0.391    0.481   0.421
-----------------------------------------------

.         
.         generate hi_sd = coop + invttail(n-1,0.025)*(sdcoop / sqrt(n))  

.         generate low_sd = coop - invttail(n-1,0.025)*(sdcoop/ sqrt(n))

. 
.         gen position=treat

.         replace position = 1 if treat==1
(0 real changes made)

.         replace position = 2.5 if treat==2
(3 real changes made)

.         replace position = 4 if treat==3
(3 real changes made)

.         replace position = 5.5 if treat==4
(3 real changes made)

.                 
.         replace position=position+0.35 if country==3
(4 real changes made)

.         replace position=position-0.35 if country==1
(4 real changes made)

. 
.         gen avg=round(coop, 0.01)

. 
.         tw         (bar mC position if country==2, fcolor(gs14) lcolor(black))      (scatter coop position if country==1, sort connect(none) lpattern(solid) msymb
> ol(T)  mfc(green) mlc(black) mlw(medthin)  msiz(medlarge)   mlab() mlabpos(12) mlabgap(5) mlabcolor (black) mlabsize(small))    (scatter coop position if country=
> =2, sort connect(none)  lpattern(dash)  msymbol(O)      mfc(red) mlc(black) mlw(medthin)  msiz(medlarge)  mlab() mlabpos(12) mlabgap(5) mlabcolor (black) mlabsize
> (small))      (scatter coop position if country==3, sort msymbol(S)   connect(none)  lpattern(dash)  mfc(blue) mlc(black) mlw(medthin)  msiz(medlarge)  mlab() mla
> bpos(12) mlabgap(5) mlabcolor (black) mlabsize(small))                     (rcap low_sd hi_sd position, vertical bcolor(black) lwidth(medthin)) ,   xscale(range(0
>  5)) xlabels(1 "Neutral"  2.5 "Converge" 4 "Diverge"  5.5 "Neutral+" 6.5 " ", labs(medsmall) nogrid)    xtitle("", size(medsmall) )    yscale(range(0 1))  ylabels
> (0(0.2)1, labs(medsmall) nogrid)   ytitle(Cooperation Rate, size(medsmall))   scale(1.4) graphregion(style(none) color(gs16))    plotregion(margin(zero))   legend
> (order( 1 "Overall"  2 "Disadv."  3 "Middle"   4  "Advan.")  ring(0) pos(12) rows(1)  size(small) symxsize(*0.5))         

. 
.         graph export Coop-Gap.eps, as(eps) preview(off) replace 
(file Coop-Gap.eps not found)
file Coop-Gap.eps saved as EPS format

. 
. restore

. 
. 
. 
. *================================================
. *       COOPERATION in MIXED GROUPS by TYPE (PHASE 1)           
. *================================================
. use $data 

. preserve

.         keep if treat<5
(10,008 observations deleted)

.         keep if groupsize==12
(47,544 observations deleted)

.         collapse choice, by(treatment sessionID country)

.         
.         local country  "1 2 3 "

.         foreach i of local country {
  2.                 dis " "
  3.                 dis "********************************************** "
  4.                 dis "==       COOPERATION:  Country =" `i'  "     =="
  5.                 dis "********************************************** "
  6.                 ranksumex choice if country==`i' & inlist(treatment, 1,2), by(treatment)
  7.                 ranksumex choice if country==`i' & inlist(treatment, 1,3), by(treatment)
  8.                 ranksumex choice if country==`i' & inlist(treatment, 1,4), by(treatment)
  9.                 ranksumex choice if country==`i' & inlist(treatment, 2,3), by(treatment)
 10.                 ranksumex choice if country==`i' & inlist(treatment, 2,4), by(treatment)
 11.                 ranksumex choice if country==`i' & inlist(treatment, 3,4), by(treatment)
 12.         }
 
********************************************** 
==       COOPERATION:  Country =1     ==
********************************************** 

Two-sample Wilcoxon rank-sum (Mann-Whitney) test

   treatment |      obs    rank sum    expected
-------------+---------------------------------
     Neutral |        8          66          68
    Converge |        8          70          68
-------------+---------------------------------
    combined |       16         136         136

Exact statistics
Ho: choice(treatm~t==Neutral) = choice(treatm~t==Converge)
    Prob <=        66 = 0.4392
    Prob >=        70 = 0.4392
    Two-sided p-value = 0.8785

Two-sample Wilcoxon rank-sum (Mann-Whitney) test

   treatment |      obs    rank sum    expected
-------------+---------------------------------
     Neutral |        8        73.5          68
     Diverge |        8        62.5          68
-------------+---------------------------------
    combined |       16         136         136

Exact statistics
Ho: choice(treatm~t==Neutral) = choice(treatm~t==Diverge)
    Prob <=      62.5 = 0.2963
    Prob >=      73.5 = 0.2963
    Two-sided p-value = 0.5925

Two-sample Wilcoxon rank-sum (Mann-Whitney) test

   treatment |      obs    rank sum    expected
-------------+---------------------------------
     Neutral |        8          66          68
    Neutral+ |        8          70          68
-------------+---------------------------------
    combined |       16         136         136

Exact statistics
Ho: choice(treatm~t==Neutral) = choice(treatm~t==Neutral+)
    Prob <=        66 = 0.4392
    Prob >=        70 = 0.4392
    Two-sided p-value = 0.8785

Two-sample Wilcoxon rank-sum (Mann-Whitney) test

   treatment |      obs    rank sum    expected
-------------+---------------------------------
    Converge |        8          80          68
     Diverge |        8          56          68
-------------+---------------------------------
    combined |       16         136         136

Exact statistics
Ho: choice(treatm~t==Converge) = choice(treatm~t==Diverge)
    Prob <=        56 = 0.1172
    Prob >=        80 = 0.1172
    Two-sided p-value = 0.2345

Two-sample Wilcoxon rank-sum (Mann-Whitney) test

   treatment |      obs    rank sum    expected
-------------+---------------------------------
    Converge |        8          69          68
    Neutral+ |        8          67          68
-------------+---------------------------------
    combined |       16         136         136

Exact statistics
Ho: choice(treatm~t==Converge) = choice(treatm~t==Neutral+)
    Prob <=        67 = 0.4796
    Prob >=        69 = 0.4796
    Two-sided p-value = 0.9591

Two-sample Wilcoxon rank-sum (Mann-Whitney) test

   treatment |      obs    rank sum    expected
-------------+---------------------------------
     Diverge |        8          54          68
    Neutral+ |        8          82          68
-------------+---------------------------------
    combined |       16         136         136

Exact statistics
Ho: choice(treatm~t==Diverge) = choice(treatm~t==Neutral+)
    Prob <=        54 = 0.0803
    Prob >=        82 = 0.0803
    Two-sided p-value = 0.1605
 
********************************************** 
==       COOPERATION:  Country =2     ==
********************************************** 

Two-sample Wilcoxon rank-sum (Mann-Whitney) test

   treatment |      obs    rank sum    expected
-------------+---------------------------------
     Neutral |        8          70          68
    Converge |        8          66          68
-------------+---------------------------------
    combined |       16         136         136

Exact statistics
Ho: choice(treatm~t==Neutral) = choice(treatm~t==Converge)
    Prob <=        66 = 0.4392
    Prob >=        70 = 0.4392
    Two-sided p-value = 0.8785

Two-sample Wilcoxon rank-sum (Mann-Whitney) test

   treatment |      obs    rank sum    expected
-------------+---------------------------------
     Neutral |        8          75          68
     Diverge |        8          61          68
-------------+---------------------------------
    combined |       16         136         136

Exact statistics
Ho: choice(treatm~t==Neutral) = choice(treatm~t==Diverge)
    Prob <=        61 = 0.2527
    Prob >=        75 = 0.2527
    Two-sided p-value = 0.5054

Two-sample Wilcoxon rank-sum (Mann-Whitney) test

   treatment |      obs    rank sum    expected
-------------+---------------------------------
     Neutral |        8          67          68
    Neutral+ |        8          69          68
-------------+---------------------------------
    combined |       16         136         136

Exact statistics
Ho: choice(treatm~t==Neutral) = choice(treatm~t==Neutral+)
    Prob <=        67 = 0.4796
    Prob >=        69 = 0.4796
    Two-sided p-value = 0.9591

Two-sample Wilcoxon rank-sum (Mann-Whitney) test

   treatment |      obs    rank sum    expected
-------------+---------------------------------
    Converge |        8          73          68
     Diverge |        8          63          68
-------------+---------------------------------
    combined |       16         136         136

Exact statistics
Ho: choice(treatm~t==Converge) = choice(treatm~t==Diverge)
    Prob <=        63 = 0.3227
    Prob >=        73 = 0.3227
    Two-sided p-value = 0.6454

Two-sample Wilcoxon rank-sum (Mann-Whitney) test

   treatment |      obs    rank sum    expected
-------------+---------------------------------
    Converge |        8          61          68
    Neutral+ |        8          75          68
-------------+---------------------------------
    combined |       16         136         136

Exact statistics
Ho: choice(treatm~t==Converge) = choice(treatm~t==Neutral+)
    Prob <=        61 = 0.2527
    Prob >=        75 = 0.2527
    Two-sided p-value = 0.5054

Two-sample Wilcoxon rank-sum (Mann-Whitney) test

   treatment |      obs    rank sum    expected
-------------+---------------------------------
     Diverge |        8          56          68
    Neutral+ |        8          80          68
-------------+---------------------------------
    combined |       16         136         136

Exact statistics
Ho: choice(treatm~t==Diverge) = choice(treatm~t==Neutral+)
    Prob <=        56 = 0.1172
    Prob >=        80 = 0.1172
    Two-sided p-value = 0.2345
 
********************************************** 
==       COOPERATION:  Country =3     ==
********************************************** 

Two-sample Wilcoxon rank-sum (Mann-Whitney) test

   treatment |      obs    rank sum    expected
-------------+---------------------------------
     Neutral |        8          71          68
    Converge |        8          65          68
-------------+---------------------------------
    combined |       16         136         136

Exact statistics
Ho: choice(treatm~t==Neutral) = choice(treatm~t==Converge)
    Prob <=        65 = 0.3887
    Prob >=        71 = 0.3887
    Two-sided p-value = 0.7773

Two-sample Wilcoxon rank-sum (Mann-Whitney) test

   treatment |      obs    rank sum    expected
-------------+---------------------------------
     Neutral |        8          72          68
     Diverge |        8          64          68
-------------+---------------------------------
    combined |       16         136         136

Exact statistics
Ho: choice(treatm~t==Neutral) = choice(treatm~t==Diverge)
    Prob <=        64 = 0.3605
    Prob >=        72 = 0.3605
    Two-sided p-value = 0.7209

Two-sample Wilcoxon rank-sum (Mann-Whitney) test

   treatment |      obs    rank sum    expected
-------------+---------------------------------
     Neutral |        8          60          68
    Neutral+ |        8          76          68
-------------+---------------------------------
    combined |       16         136         136

Exact statistics
Ho: choice(treatm~t==Neutral) = choice(treatm~t==Neutral+)
    Prob <=        60 = 0.2209
    Prob >=        76 = 0.2209
    Two-sided p-value = 0.4418

Two-sample Wilcoxon rank-sum (Mann-Whitney) test

   treatment |      obs    rank sum    expected
-------------+---------------------------------
    Converge |        8          69          68
     Diverge |        8          67          68
-------------+---------------------------------
    combined |       16         136         136

Exact statistics
Ho: choice(treatm~t==Converge) = choice(treatm~t==Diverge)
    Prob <=        67 = 0.4685
    Prob >=        69 = 0.4685
    Two-sided p-value = 0.9369

Two-sample Wilcoxon rank-sum (Mann-Whitney) test

   treatment |      obs    rank sum    expected
-------------+---------------------------------
    Converge |        8          53          68
    Neutral+ |        8          83          68
-------------+---------------------------------
    combined |       16         136         136

Exact statistics
Ho: choice(treatm~t==Converge) = choice(treatm~t==Neutral+)
    Prob <=        53 = 0.0614
    Prob >=        83 = 0.0614
    Two-sided p-value = 0.1228

Two-sample Wilcoxon rank-sum (Mann-Whitney) test

   treatment |      obs    rank sum    expected
-------------+---------------------------------
     Diverge |        8          57          68
    Neutral+ |        8          79          68
-------------+---------------------------------
    combined |       16         136         136

Exact statistics
Ho: choice(treatm~t==Diverge) = choice(treatm~t==Neutral+)
    Prob <=        57 = 0.1393
    Prob >=        79 = 0.1393
    Two-sided p-value = 0.2786

. 
.         restore

. 
. 
. *=========================================================================
. *       COOPERATION  in MIXED GROUPS (PHASE 1 & PHASE 2) : 1 obs = 1 PLAYER TYPE
. *=========================================================================
. use $data 

. preserve

.         graph drop _all

.         keep if treat<5
(10,008 observations deleted)

.         keep if groupsize>=12
(35,496 observations deleted)

.         keep if type==1
(22,236 observations deleted)

.                 
.         macro define controls "sex duration response_t wrong_ans"               

.         collapse outcome  $controls, by (treatment sessionID game groupID country order)

.                 center response_t wrong_ans duration, inplace  standardize 
(modified variables: response_t wrong_ans duration)

.                 gen game2=(game==2 | game==4)

.         
. *** GLM regressions     
.         est clear

.         glm  outcome   i.treat    i.game2   i.order $controls if country==1 & game<5, cluster(sessionID) link(logit) family(binomial) robust nolog 
note: outcome has noninteger values

Generalized linear models                         Number of obs   =        128
Optimization     : ML                             Residual df     =        118
                                                  Scale parameter =          1
Deviance         =  25.79257551                   (1/df) Deviance =   .2185811
Pearson          =  23.85911008                   (1/df) Pearson  =   .2021958

Variance function: V(u) = u*(1-u/1)               [Binomial]
Link function    : g(u) = ln(u/(1-u))             [Logit]

                                                  AIC             =   1.087989
Log pseudolikelihood = -59.63132098               BIC             =   -546.747

                             (Std. err. adjusted for 32 clusters in sessionID)
------------------------------------------------------------------------------
             |               Robust
     outcome | Coefficient  std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
   treatment |
   Converge  |    .144912   .2746088     0.53   0.598    -.3933112    .6831353
    Diverge  |  -.1667139   .3011171    -0.55   0.580    -.7568926    .4234649
   Neutral+  |   .2079874   .2901137     0.72   0.473     -.360625    .7765998
             |
     1.game2 |  -.0375299   .1094418    -0.34   0.732     -.252032    .1769721
             |
       order |
large first  |  -.4802994   .2127347    -2.26   0.024    -.8972518    -.063347
         sex |    .577358    .391623     1.47   0.140    -.1902091    1.344925
    duration |  -.0969795   .0676125    -1.43   0.151    -.2294976    .0355386
  response_t |  -.0044845    .088844    -0.05   0.960    -.1786155    .1696466
   wrong_ans |   -.089134   .0797204    -1.12   0.264     -.245383     .067115
       _cons |  -.6137557   .2233313    -2.75   0.006    -1.051477   -.1760345
------------------------------------------------------------------------------

.         margins, dydx(*) at((base) _factor (asobs) $controls ) post

Average marginal effects                                   Number of obs = 128
Model VCE: Robust

Expression: Predicted mean outcome, predict()
dy/dx wrt:  2.treatment 3.treatment 4.treatment 1.game2 1.order sex duration response_t wrong_ans
At: treatment = 1
    game2     = 0
    order     = 0

------------------------------------------------------------------------------
             |            Delta-method
             |      dy/dx   std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
   treatment |
   Converge  |   .0352149   .0668952     0.53   0.599    -.0958974    .1663271
    Diverge  |   -.039448   .0706013    -0.56   0.576    -.1778241    .0989281
   Neutral+  |   .0507217   .0706712     0.72   0.473    -.0877914    .1892347
             |
     1.game2 |  -.0089953   .0262577    -0.34   0.732    -.0604594    .0424688
             |
       order |
large first  |  -.1090613   .0480174    -2.27   0.023    -.2031737   -.0149489
         sex |   .1388352   .0949889     1.46   0.144    -.0473396      .32501
    duration |  -.0233203   .0160599    -1.45   0.146     -.054797    .0081564
  response_t |  -.0010784   .0213539    -0.05   0.960    -.0429313    .0407746
   wrong_ans |  -.0214337   .0191399    -1.12   0.263    -.0589473    .0160798
------------------------------------------------------------------------------
Note: dy/dx for factor levels is the discrete change from the base level.

.         test 2.treatment=3.treatment

 ( 1)  2.treatment - 3.treatment = 0

           chi2(  1) =    0.90
         Prob > chi2 =    0.3431

.         test 2.treatment=4.treatment

 ( 1)  2.treatment - 4.treatment = 0

           chi2(  1) =    0.04
         Prob > chi2 =    0.8460

.         test 3.treatment=4.treatment

 ( 1)  3.treatment - 4.treatment = 0

           chi2(  1) =    1.21
         Prob > chi2 =    0.2716

.         eststo reg1

. 
.         glm  outcome   i.treat    i.game2   i.order  $controls if country==2  & game<5, cluster(sessionID) link(logit) family(binomial) robust nolog 
note: outcome has noninteger values

Generalized linear models                         Number of obs   =        128
Optimization     : ML                             Residual df     =        118
                                                  Scale parameter =          1
Deviance         =  26.99777114                   (1/df) Deviance =   .2287947
Pearson          =  25.10708201                   (1/df) Pearson  =   .2127719

Variance function: V(u) = u*(1-u/1)               [Binomial]
Link function    : g(u) = ln(u/(1-u))             [Logit]

                                                  AIC             =   1.074546
Log pseudolikelihood = -58.77093907               BIC             =  -545.5418

                             (Std. err. adjusted for 32 clusters in sessionID)
------------------------------------------------------------------------------
             |               Robust
     outcome | Coefficient  std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
   treatment |
   Converge  |  -.1843998   .3160242    -0.58   0.560    -.8037958    .4349962
    Diverge  |  -.4184286   .3601039    -1.16   0.245    -1.124219    .2873621
   Neutral+  |   .0773163   .3014814     0.26   0.798    -.5135765     .668209
             |
     1.game2 |  -.1346977   .1070211    -1.26   0.208    -.3444551    .0750598
             |
       order |
large first  |  -.6908761   .2335814    -2.96   0.003    -1.148687   -.2330651
         sex |   .6161616   .3613716     1.71   0.088    -.0921136    1.324437
    duration |    .046666   .0678132     0.69   0.491    -.0862455    .1795776
  response_t |   .0149898   .1223663     0.12   0.903    -.2248438    .2548234
   wrong_ans |  -.0686948   .0635496    -1.08   0.280    -.1932498    .0558601
       _cons |  -.3337646   .3068373    -1.09   0.277    -.9351546    .2676255
------------------------------------------------------------------------------

.         margins, dydx(*) at((base) _factor (asobs) $controls ) post

Average marginal effects                                   Number of obs = 128
Model VCE: Robust

Expression: Predicted mean outcome, predict()
dy/dx wrt:  2.treatment 3.treatment 4.treatment 1.game2 1.order sex duration response_t wrong_ans
At: treatment = 1
    game2     = 0
    order     = 0

------------------------------------------------------------------------------
             |            Delta-method
             |      dy/dx   std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
   treatment |
   Converge  |  -.0454215   .0778752    -0.58   0.560     -.198054     .107211
    Diverge  |   -.101503   .0866937    -1.17   0.242    -.2714195    .0684134
   Neutral+  |   .0191745   .0747328     0.26   0.798    -.1272992    .1656481
             |
     1.game2 |    -.03325    .026421    -1.26   0.208    -.0850341    .0185342
             |
       order |
large first  |  -.1629526   .0553589    -2.94   0.003     -.271454   -.0544511
         sex |   .1526782   .0887726     1.72   0.085     -.021313    .3266694
    duration |   .0115633   .0167898     0.69   0.491     -.021344    .0444707
  response_t |   .0037143   .0302995     0.12   0.902    -.0556717    .0631003
   wrong_ans |  -.0170218   .0156882    -1.09   0.278    -.0477702    .0137266
------------------------------------------------------------------------------
Note: dy/dx for factor levels is the discrete change from the base level.

.         test 2.treatment=3.treatment

 ( 1)  2.treatment - 3.treatment = 0

           chi2(  1) =    0.61
         Prob > chi2 =    0.4360

.         test 2.treatment=4.treatment

 ( 1)  2.treatment - 4.treatment = 0

           chi2(  1) =    1.27
         Prob > chi2 =    0.2603

.         test 3.treatment=4.treatment

 ( 1)  3.treatment - 4.treatment = 0

           chi2(  1) =    3.10
         Prob > chi2 =    0.0784

.         eststo reg2

. 
.         glm  outcome   i.treat    i.game2   i.order  $controls if country==3  & game<5, cluster(sessionID) link(logit) family(binomial) robust nolog 
note: outcome has noninteger values

Generalized linear models                         Number of obs   =        128
Optimization     : ML                             Residual df     =        118
                                                  Scale parameter =          1
Deviance         =  26.46665613                   (1/df) Deviance =   .2242937
Pearson          =  23.78626433                   (1/df) Pearson  =   .2015785

Variance function: V(u) = u*(1-u/1)               [Binomial]
Link function    : g(u) = ln(u/(1-u))             [Logit]

                                                  AIC             =   1.118263
Log pseudolikelihood = -61.56882265               BIC             =  -546.0729

                             (Std. err. adjusted for 32 clusters in sessionID)
------------------------------------------------------------------------------
             |               Robust
     outcome | Coefficient  std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
   treatment |
   Converge  |  -.2212164   .2109503    -1.05   0.294    -.6346714    .1922386
    Diverge  |  -.1142485   .3015395    -0.38   0.705    -.7052551    .4767581
   Neutral+  |   .2314745   .2169728     1.07   0.286    -.1937843    .6567334
             |
     1.game2 |  -.0679839   .0950513    -0.72   0.474    -.2542809    .1183132
             |
       order |
large first  |  -.4957403   .1861847    -2.66   0.008    -.8606556   -.1308249
         sex |  -.1651893   .3170467    -0.52   0.602    -.7865895    .4562109
    duration |   .0598136   .0734651     0.81   0.416    -.0841755    .2038026
  response_t |   .0121189   .0908449     0.13   0.894    -.1659338    .1901716
   wrong_ans |  -.2081673   .1170074    -1.78   0.075    -.4374975    .0211629
       _cons |   .1065003   .2476084     0.43   0.667    -.3788032    .5918039
------------------------------------------------------------------------------

.         margins, dydx(*) at((base) _factor (asobs) $controls ) post

Average marginal effects                                   Number of obs = 128
Model VCE: Robust

Expression: Predicted mean outcome, predict()
dy/dx wrt:  2.treatment 3.treatment 4.treatment 1.game2 1.order sex duration response_t wrong_ans
At: treatment = 1
    game2     = 0
    order     = 0

------------------------------------------------------------------------------
             |            Delta-method
             |      dy/dx   std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
   treatment |
   Converge  |  -.0544746   .0517274    -1.05   0.292    -.1558584    .0469093
    Diverge  |  -.0282121   .0743241    -0.38   0.704    -.1738848    .1174605
   Neutral+  |   .0569561   .0534284     1.07   0.286    -.0477617     .161674
             |
     1.game2 |  -.0167984    .023469    -0.72   0.474    -.0627969    .0292001
             |
       order |
large first  |   -.120215    .044118    -2.72   0.006    -.2066847   -.0337452
         sex |    -.04083   .0783275    -0.52   0.602     -.194349    .1126891
    duration |   .0147842   .0180949     0.82   0.414    -.0206811    .0502495
  response_t |   .0029954   .0224624     0.13   0.894    -.0410301     .047021
   wrong_ans |  -.0514528   .0283332    -1.82   0.069    -.1069849    .0040792
------------------------------------------------------------------------------
Note: dy/dx for factor levels is the discrete change from the base level.

.         test 2.treatment=3.treatment

 ( 1)  2.treatment - 3.treatment = 0

           chi2(  1) =    0.15
         Prob > chi2 =    0.6953

.         test 2.treatment=4.treatment

 ( 1)  2.treatment - 4.treatment = 0

           chi2(  1) =    8.15
         Prob > chi2 =    0.0043

.         test 3.treatment=4.treatment

 ( 1)  3.treatment - 4.treatment = 0

           chi2(  1) =    1.50
         Prob > chi2 =    0.2200

.         eststo reg3

. 
.         estout * using output4.tex,  replace cells("b(star fmt(3)) se(par fmt(3))") style(tex) label varlabels(1.order "Order 12-12-2-2"  1.game2 "$2^{nd}$ Superg
> ame" duration "Duration" wrong_ans "Incorrect Answers" _cons Constant response_t "Response Time"   1.sex "Male"  sex "Male") collabels(,none) stats(N, labels("N")
>  fmt(0 3)) prefoot(\hline) starlevels(* 0.10 ** 0.05 *** 0.01) posthead(\hline) margin(p) nobaselevel
(file output4.tex not found)
(output written to output4.tex)

. 
.         gen game5=(game==5)

. 
.         est clear

.         glm  outcome   i.treat    i.game2   i.order i.game5 $controls if country==1, cluster(sessionID) link(logit) family(binomial) robust nolog 
note: outcome has noninteger values

Generalized linear models                         Number of obs   =        151
Optimization     : ML                             Residual df     =        140
                                                  Scale parameter =          1
Deviance         =  28.24947369                   (1/df) Deviance =    .201782
Pearson          =  26.25006326                   (1/df) Pearson  =   .1875005

Variance function: V(u) = u*(1-u/1)               [Binomial]
Link function    : g(u) = ln(u/(1-u))             [Logit]

                                                  AIC             =   1.066505
Log pseudolikelihood = -69.52116398               BIC             =  -674.1697

                             (Std. err. adjusted for 32 clusters in sessionID)
------------------------------------------------------------------------------
             |               Robust
     outcome | Coefficient  std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
   treatment |
   Converge  |   .1123975   .2611333     0.43   0.667    -.3994144    .6242093
    Diverge  |  -.2165722   .2789422    -0.78   0.438    -.7632889    .3301446
   Neutral+  |   .1948357   .2719102     0.72   0.474    -.3380985    .7277698
             |
     1.game2 |  -.0360686   .1086132    -0.33   0.740    -.2489466    .1768094
             |
       order |
large first  |  -.3728294   .2031977    -1.83   0.067    -.7710895    .0254308
     1.game5 |  -.3568977   .1693461    -2.11   0.035    -.6888099   -.0249856
         sex |   .4780293    .390505     1.22   0.221    -.2873464    1.243405
    duration |  -.1026714   .0563512    -1.82   0.068    -.2131176    .0077749
  response_t |  -.0215049   .0880148    -0.24   0.807    -.1940108    .1510009
   wrong_ans |  -.0978993   .0805925    -1.21   0.224    -.2558577     .060059
       _cons |  -.6026836   .2310457    -2.61   0.009    -1.055525   -.1498424
------------------------------------------------------------------------------

.         margins, dydx(*) at((base) _factor (asobs) $controls ) post

Average marginal effects                                   Number of obs = 151
Model VCE: Robust

Expression: Predicted mean outcome, predict()
dy/dx wrt:  2.treatment 3.treatment 4.treatment 1.game2 1.order 1.game5 sex duration response_t wrong_ans
At: treatment = 1
    game2     = 0
    order     = 0
    game5     = 0

------------------------------------------------------------------------------
             |            Delta-method
             |      dy/dx   std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
   treatment |
   Converge  |   .0271668   .0632291     0.43   0.667    -.0967599    .1510935
    Diverge  |  -.0506718    .064446    -0.79   0.432    -.1769836      .07564
   Neutral+  |   .0473525   .0659547     0.72   0.473    -.0819164    .1766214
             |
     1.game2 |  -.0086085    .025942    -0.33   0.740    -.0594539     .042237
             |
       order |
large first  |  -.0854196   .0465915    -1.83   0.067    -.1767373    .0058981
     1.game5 |  -.0819572   .0392439    -2.09   0.037     -.158874   -.0050405
         sex |   .1144776   .0942315     1.21   0.224    -.0702127     .299168
    duration |  -.0245876   .0132813    -1.85   0.064    -.0506185    .0014433
  response_t |    -.00515   .0210249    -0.24   0.806    -.0463581    .0360581
   wrong_ans |  -.0234448   .0192159    -1.22   0.222    -.0611072    .0142177
------------------------------------------------------------------------------
Note: dy/dx for factor levels is the discrete change from the base level.

.         test 2.treatment=3.treatment

 ( 1)  2.treatment - 3.treatment = 0

           chi2(  1) =    1.13
         Prob > chi2 =    0.2877

.         test 2.treatment=4.treatment

 ( 1)  2.treatment - 4.treatment = 0

           chi2(  1) =    0.07
         Prob > chi2 =    0.7905

.         test 3.treatment=4.treatment

 ( 1)  3.treatment - 4.treatment = 0

           chi2(  1) =    1.71
         Prob > chi2 =    0.1910

.         eststo reg1

. 
.         glm  outcome   i.treat    i.game2   i.order  i.game5  $controls if country==2, cluster(sessionID) link(logit) family(binomial) robust nolog 
note: outcome has noninteger values

Generalized linear models                         Number of obs   =        155
Optimization     : ML                             Residual df     =        144
                                                  Scale parameter =          1
Deviance         =  29.70820205                   (1/df) Deviance =    .206307
Pearson          =  27.62168522                   (1/df) Pearson  =   .1918173

Variance function: V(u) = u*(1-u/1)               [Binomial]
Link function    : g(u) = ln(u/(1-u))             [Logit]

                                                  AIC             =    1.05468
Log pseudolikelihood = -70.73766851               BIC             =   -696.545

                             (Std. err. adjusted for 32 clusters in sessionID)
------------------------------------------------------------------------------
             |               Robust
     outcome | Coefficient  std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
   treatment |
   Converge  |   -.214385   .3064494    -0.70   0.484    -.8150149    .3862449
    Diverge  |  -.3992592   .3345989    -1.19   0.233    -1.055061    .2565426
   Neutral+  |   .0375519   .3005788     0.12   0.901    -.5515716    .6266755
             |
     1.game2 |  -.1318553   .1049285    -1.26   0.209    -.3375115    .0738008
             |
       order |
large first  |  -.5842754   .2220326    -2.63   0.009    -1.019451   -.1490995
     1.game5 |  -.2201303   .1465598    -1.50   0.133    -.5073822    .0671217
         sex |   .5964319   .3543558     1.68   0.092    -.0980927    1.290956
    duration |   .0355036   .0622578     0.57   0.568    -.0865194    .1575266
  response_t |    .001649   .1225883     0.01   0.989    -.2386197    .2419176
   wrong_ans |  -.0703557   .0654726    -1.07   0.283    -.1986796    .0579681
       _cons |  -.3607897   .3036116    -1.19   0.235    -.9558575    .2342782
------------------------------------------------------------------------------

.         margins, dydx(*) at((base) _factor (asobs) $controls ) post

Average marginal effects                                   Number of obs = 155
Model VCE: Robust

Expression: Predicted mean outcome, predict()
dy/dx wrt:  2.treatment 3.treatment 4.treatment 1.game2 1.order 1.game5 sex duration response_t wrong_ans
At: treatment = 1
    game2     = 0
    order     = 0
    game5     = 0

------------------------------------------------------------------------------
             |            Delta-method
             |      dy/dx   std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
   treatment |
   Converge  |  -.0526207   .0753834    -0.70   0.485    -.2003694    .0951281
    Diverge  |  -.0966578    .080747    -1.20   0.231     -.254919    .0616034
   Neutral+  |   .0093104   .0744934     0.12   0.901    -.1366939    .1553147
             |
     1.game2 |  -.0325073   .0258895    -1.26   0.209    -.0832498    .0182353
             |
       order |
large first  |  -.1388017   .0530467    -2.62   0.009    -.2427713   -.0348322
     1.game5 |  -.0540121   .0361688    -1.49   0.135    -.1249015    .0168774
         sex |   .1477496   .0873374     1.69   0.091    -.0234285    .3189277
    duration |    .008795    .015436     0.57   0.569    -.0214589     .039049
  response_t |   .0004085   .0303654     0.01   0.989    -.0591066    .0599235
   wrong_ans |  -.0174287   .0161468    -1.08   0.280    -.0490757    .0142184
------------------------------------------------------------------------------
Note: dy/dx for factor levels is the discrete change from the base level.

.         test 2.treatment=3.treatment

 ( 1)  2.treatment - 3.treatment = 0

           chi2(  1) =    0.44
         Prob > chi2 =    0.5090

.         test 2.treatment=4.treatment

 ( 1)  2.treatment - 4.treatment = 0

           chi2(  1) =    1.14
         Prob > chi2 =    0.2866

.         test 3.treatment=4.treatment

 ( 1)  3.treatment - 4.treatment = 0

           chi2(  1) =    2.76
         Prob > chi2 =    0.0967

.         eststo reg2

. 
.         glm  outcome   i.treat    i.game2   i.order  i.game5  $controls if country==3, cluster(sessionID) link(logit) family(binomial) robust nolog 
note: outcome has noninteger values

Generalized linear models                         Number of obs   =        148
Optimization     : ML                             Residual df     =        137
                                                  Scale parameter =          1
Deviance         =  29.46402642                   (1/df) Deviance =   .2150659
Pearson          =  26.65798487                   (1/df) Pearson  =   .1945838

Variance function: V(u) = u*(1-u/1)               [Binomial]
Link function    : g(u) = ln(u/(1-u))             [Logit]

                                                  AIC             =   1.109483
Log pseudolikelihood = -71.10176666               BIC             =  -655.1541

                             (Std. err. adjusted for 32 clusters in sessionID)
------------------------------------------------------------------------------
             |               Robust
     outcome | Coefficient  std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
   treatment |
   Converge  |  -.1686853   .2105143    -0.80   0.423    -.5812857    .2439151
    Diverge  |   -.082904   .2779356    -0.30   0.765    -.6276478    .4618399
   Neutral+  |   .2314529   .2072872     1.12   0.264    -.1748226    .6377284
             |
     1.game2 |  -.0548412   .0907145    -0.60   0.545    -.2326384     .122956
             |
       order |
large first  |   -.429936   .1800153    -2.39   0.017    -.7827595   -.0771126
     1.game5 |  -.1246576   .1736933    -0.72   0.473    -.4650903    .2157751
         sex |  -.2179877   .3218668    -0.68   0.498    -.8488351    .4128597
    duration |  -.0126666   .0534786    -0.24   0.813    -.1174826    .0921495
  response_t |   .0319694   .0953771     0.34   0.737    -.1549663    .2189051
   wrong_ans |  -.2277849   .1186069    -1.92   0.055    -.4602502    .0046805
       _cons |    .069899   .2504993     0.28   0.780    -.4210705    .5608686
------------------------------------------------------------------------------

.         margins, dydx(*) at((base) _factor (asobs) $controls ) post

Average marginal effects                                   Number of obs = 148
Model VCE: Robust

Expression: Predicted mean outcome, predict()
dy/dx wrt:  2.treatment 3.treatment 4.treatment 1.game2 1.order 1.game5 sex duration response_t wrong_ans
At: treatment = 1
    game2     = 0
    order     = 0
    game5     = 0

------------------------------------------------------------------------------
             |            Delta-method
             |      dy/dx   std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
   treatment |
   Converge  |  -.0414398   .0516261    -0.80   0.422    -.1426251    .0597455
    Diverge  |  -.0204256   .0683717    -0.30   0.765    -.1544317    .1135804
   Neutral+  |   .0570564   .0510468     1.12   0.264    -.0429936    .1571064
             |
     1.game2 |   -.013521   .0223417    -0.61   0.545    -.0573099     .030268
             |
       order |
large first  |  -.1039518   .0428202    -2.43   0.015    -.1878779   -.0200258
     1.game5 |  -.0306739   .0425689    -0.72   0.471    -.1141073    .0527595
         sex |  -.0537978   .0794364    -0.68   0.498    -.2094903    .1018947
    duration |   -.003126   .0131951    -0.24   0.813     -.028988     .022736
  response_t |   .0078898   .0235487     0.34   0.738    -.0382648    .0540444
   wrong_ans |  -.0562157   .0286634    -1.96   0.050    -.1123949   -.0000365
------------------------------------------------------------------------------
Note: dy/dx for factor levels is the discrete change from the base level.

.         test 2.treatment=3.treatment

 ( 1)  2.treatment - 3.treatment = 0

           chi2(  1) =    0.10
         Prob > chi2 =    0.7490

.         test 2.treatment=4.treatment

 ( 1)  2.treatment - 4.treatment = 0

           chi2(  1) =    5.83
         Prob > chi2 =    0.0158

.         test 3.treatment=4.treatment

 ( 1)  3.treatment - 4.treatment = 0

           chi2(  1) =    1.36
         Prob > chi2 =    0.2438

.         eststo reg3

. 
.         estout * using output5.tex,  replace cells("b(star fmt(3)) se(par fmt(3))") style(tex) label varlabels(1.order "Order 12-12-2-2"  1.game2 "$2^{nd}$ Superg
> ame" duration "Duration" wrong_ans "Incorrect Answers" _cons Constant response_t "Response Time"   1.sex "Male"  sex "Male") collabels(,none) stats(N, labels("N")
>  fmt(0 3)) prefoot(\hline) starlevels(* 0.10 ** 0.05 *** 0.01) posthead(\hline) margin(p) nobaselevel
(file output5.tex not found)
(output written to output5.tex)

. 
. 
. *** GLM regressions     
.         est clear

.         glm  outcome   i.country    i.game2   i.order $controls if treat==1 & game<5, cluster(sessionID) link(logit) family(binomial) robust nolog 
note: outcome has noninteger values

Generalized linear models                         Number of obs   =         96
Optimization     : ML                             Residual df     =         89
                                                  Scale parameter =          1
Deviance         =  16.96518364                   (1/df) Deviance =     .19062
Pearson          =  15.21696626                   (1/df) Pearson  =   .1709771

Variance function: V(u) = u*(1-u/1)               [Binomial]
Link function    : g(u) = ln(u/(1-u))             [Logit]

                                                  AIC             =   1.056855
Log pseudolikelihood = -43.72905107               BIC             =  -389.2618

                              (Std. err. adjusted for 8 clusters in sessionID)
------------------------------------------------------------------------------
             |               Robust
     outcome | Coefficient  std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
     country |
     Middle  |   .0994433    .227781     0.44   0.662    -.3469992    .5458857
     Advan.  |   .2313376   .2548536     0.91   0.364    -.2681663    .7308416
             |
     1.game2 |  -.1296774   .1673233    -0.78   0.438    -.4576249    .1982702
             |
       order |
large first  |  -.9962851   .2676639    -3.72   0.000    -1.520897   -.4716734
         sex |   .6434457   .4161781     1.55   0.122    -.1722483     1.45914
    duration |   .2092395   .1075909     1.94   0.052    -.0016349    .4201138
  response_t |   .0037081   .1142322     0.03   0.974     -.220183    .2275991
   wrong_ans |  -.0464299   .0571675    -0.81   0.417    -.1584761    .0656163
       _cons |  -.2467177   .2654705    -0.93   0.353    -.7670302    .2735948
------------------------------------------------------------------------------

.         margins, dydx(*) at((base) _factor (asobs) $controls ) post

Average marginal effects                                    Number of obs = 96
Model VCE: Robust

Expression: Predicted mean outcome, predict()
dy/dx wrt:  2.country 3.country 1.game2 1.order sex duration response_t wrong_ans
At: country = 1
    game2   = 0
    order   = 0

------------------------------------------------------------------------------
             |            Delta-method
             |      dy/dx   std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
     country |
     Middle  |   .0244769   .0559297     0.44   0.662    -.0851432    .1340971
     Advan.  |   .0567415   .0619414     0.92   0.360    -.0646614    .1781443
             |
     1.game2 |  -.0319038   .0412233    -0.77   0.439    -.1126999    .0488923
             |
       order |
large first  |  -.2277453   .0561356    -4.06   0.000     -.337769   -.1177216
         sex |   .1585081   .1016697     1.56   0.119    -.0407609    .3577772
    duration |   .0515446   .0264255     1.95   0.051    -.0002484    .1033376
  response_t |   .0009135   .0281379     0.03   0.974    -.0542359    .0560628
   wrong_ans |  -.0114377   .0140579    -0.81   0.416    -.0389907    .0161154
------------------------------------------------------------------------------
Note: dy/dx for factor levels is the discrete change from the base level.

.         test 2.country=3.country

 ( 1)  2.country - 3.country = 0

           chi2(  1) =    0.23
         Prob > chi2 =    0.6290

.         eststo reg11

. 
.         glm  outcome   i.country  i.game2   i.order  $controls if treat==2 & game<5, cluster(sessionID) link(logit) family(binomial) robust nolog 
note: outcome has noninteger values

Generalized linear models                         Number of obs   =         96
Optimization     : ML                             Residual df     =         89
                                                  Scale parameter =          1
Deviance         =  15.25773988                   (1/df) Deviance =   .1714353
Pearson          =  13.70868344                   (1/df) Pearson  =   .1540302

Variance function: V(u) = u*(1-u/1)               [Binomial]
Link function    : g(u) = ln(u/(1-u))             [Logit]

                                                  AIC             =   1.046583
Log pseudolikelihood = -43.23597018               BIC             =  -390.9692

                              (Std. err. adjusted for 8 clusters in sessionID)
------------------------------------------------------------------------------
             |               Robust
     outcome | Coefficient  std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
     country |
     Middle  |  -.0782342   .2725635    -0.29   0.774    -.6124487    .4559804
     Advan.  |   .1719445   .2179553     0.79   0.430      -.25524     .599129
             |
     1.game2 |  -.4712826   .1183429    -3.98   0.000    -.7032304   -.2393349
             |
       order |
large first  |  -.8134714   .3185085    -2.55   0.011    -1.437737   -.1892062
         sex |   .2455185   .3061824     0.80   0.423     -.354588     .845625
    duration |  -.1127478   .0789981    -1.43   0.154    -.2675812    .0420856
  response_t |  -.1133443   .1508033    -0.75   0.452    -.4089134    .1822248
   wrong_ans |  -.2453765   .0728837    -3.37   0.001    -.3882259   -.1025271
       _cons |  -.0814037   .4389464    -0.19   0.853    -.9417229    .7789154
------------------------------------------------------------------------------

.         margins, dydx(*) at((base) _factor (asobs) $controls ) post

Average marginal effects                                    Number of obs = 96
Model VCE: Robust

Expression: Predicted mean outcome, predict()
dy/dx wrt:  2.country 3.country 1.game2 1.order sex duration response_t wrong_ans
At: country = 1
    game2   = 0
    order   = 0

------------------------------------------------------------------------------
             |            Delta-method
             |      dy/dx   std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
     country |
     Middle  |  -.0191603    .066775    -0.29   0.774    -.1500369    .1117163
     Advan.  |   .0417693   .0528474     0.79   0.429    -.0618097    .1453484
             |
     1.game2 |  -.1146167    .029115    -3.94   0.000    -.1716811   -.0575523
             |
       order |
large first  |  -.1929345   .0754767    -2.56   0.011     -.340866   -.0450029
         sex |     .06004    .075681     0.79   0.428    -.0882922    .2083721
    duration |  -.0275718    .019145    -1.44   0.150    -.0650953    .0099518
  response_t |  -.0277176   .0366008    -0.76   0.449    -.0994539    .0440187
   wrong_ans |  -.0600052   .0179079    -3.35   0.001     -.095104   -.0249065
------------------------------------------------------------------------------
Note: dy/dx for factor levels is the discrete change from the base level.

.         test 2.country=3.country

 ( 1)  2.country - 3.country = 0

           chi2(  1) =    1.52
         Prob > chi2 =    0.2176

.         eststo reg12

. 
.         glm  outcome   i.country  i.game2   i.order  $controls if treat==3 & game<5, cluster(sessionID) link(logit) family(binomial) robust nolog 
note: outcome has noninteger values

Generalized linear models                         Number of obs   =         96
Optimization     : ML                             Residual df     =         89
                                                  Scale parameter =          1
Deviance         =  18.90161341                   (1/df) Deviance =   .2123777
Pearson          =  18.01029967                   (1/df) Pearson  =   .2023629

Variance function: V(u) = u*(1-u/1)               [Binomial]
Link function    : g(u) = ln(u/(1-u))             [Logit]

                                                  AIC             =   1.059854
Log pseudolikelihood = -43.87298688               BIC             =  -387.3254

                              (Std. err. adjusted for 8 clusters in sessionID)
------------------------------------------------------------------------------
             |               Robust
     outcome | Coefficient  std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
     country |
     Middle  |  -.1055651   .1999716    -0.53   0.598    -.4975022     .286372
     Advan.  |   .3470669   .1366134     2.54   0.011     .0793096    .6148242
             |
     1.game2 |   .0267824   .1634848     0.16   0.870    -.2936418    .3472066
             |
       order |
large first  |   .0481764    .425321     0.11   0.910    -.7854374    .8817902
         sex |   .2428302   .2978252     0.82   0.415    -.3408964    .8265568
    duration |   .0040061   .1480796     0.03   0.978    -.2862247    .2942368
  response_t |   .0902911   .0661778     1.36   0.172     -.039415    .2199972
   wrong_ans |  -.0087641    .112845    -0.08   0.938    -.2299362     .212408
       _cons |  -.9198764   .3859345    -2.38   0.017    -1.676294   -.1634586
------------------------------------------------------------------------------

.         margins, dydx(*) at((base) _factor (asobs) $controls ) post

Average marginal effects                                    Number of obs = 96
Model VCE: Robust

Expression: Predicted mean outcome, predict()
dy/dx wrt:  2.country 3.country 1.game2 1.order sex duration response_t wrong_ans
At: country = 1
    game2   = 0
    order   = 0

------------------------------------------------------------------------------
             |            Delta-method
             |      dy/dx   std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
     country |
     Middle  |  -.0218849   .0413493    -0.53   0.597     -.102928    .0591582
     Advan.  |   .0779427   .0376376     2.07   0.038     .0041743     .151711
             |
     1.game2 |      .0057   .0351736     0.16   0.871     -.063239     .074639
             |
       order |
large first  |   .0102946   .0903698     0.11   0.909    -.1668269    .1874161
         sex |   .0514158   .0641961     0.80   0.423    -.0744062    .1772379
    duration |   .0008482   .0313136     0.03   0.978    -.0605253    .0622218
  response_t |   .0191178   .0140898     1.36   0.175    -.0084976    .0467333
   wrong_ans |  -.0018557   .0240618    -0.08   0.939    -.0490159    .0453045
------------------------------------------------------------------------------
Note: dy/dx for factor levels is the discrete change from the base level.

.         test 2.country=3.country

 ( 1)  2.country - 3.country = 0

           chi2(  1) =    4.22
         Prob > chi2 =    0.0399

.         eststo reg13

. 
.         glm  outcome   i.country  i.game2   i.order  $controls if treat==4 & game<5, cluster(sessionID) link(logit) family(binomial) robust nolog 
note: outcome has noninteger values

Generalized linear models                         Number of obs   =         96
Optimization     : ML                             Residual df     =         89
                                                  Scale parameter =          1
Deviance         =  22.62529496                   (1/df) Deviance =   .2542168
Pearson          =  20.32197898                   (1/df) Pearson  =   .2283368

Variance function: V(u) = u*(1-u/1)               [Binomial]
Link function    : g(u) = ln(u/(1-u))             [Logit]

                                                  AIC             =   1.112073
Log pseudolikelihood = -46.37948913               BIC             =  -383.6017

                              (Std. err. adjusted for 8 clusters in sessionID)
------------------------------------------------------------------------------
             |               Robust
     outcome | Coefficient  std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
     country |
     Middle  |   .0231719   .2615144     0.09   0.929    -.4893868    .5357307
     Advan.  |   .3402442   .2268217     1.50   0.134    -.1043182    .7848066
             |
     1.game2 |   .2288418   .1949588     1.17   0.240    -.1532703     .610954
             |
       order |
large first  |  -.5579852   .1939681    -2.88   0.004    -.9381557   -.1778147
         sex |   .0332439   .4233396     0.08   0.937    -.7964866    .8629743
    duration |  -.0229387   .0743015    -0.31   0.758    -.1685668    .1226895
  response_t |  -.1096077    .047451    -2.31   0.021    -.2026098   -.0166055
   wrong_ans |  -.1462323   .1147054    -1.27   0.202    -.3710507    .0785861
       _cons |  -.2319193    .282636    -0.82   0.412    -.7858756     .322037
------------------------------------------------------------------------------

.         margins, dydx(*) at((base) _factor (asobs) $controls ) post

Average marginal effects                                    Number of obs = 96
Model VCE: Robust

Expression: Predicted mean outcome, predict()
dy/dx wrt:  2.country 3.country 1.game2 1.order sex duration response_t wrong_ans
At: country = 1
    game2   = 0
    order   = 0

------------------------------------------------------------------------------
             |            Delta-method
             |      dy/dx   std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
     country |
     Middle  |   .0056345    .063615     0.09   0.929    -.1190486    .1303176
     Advan.  |   .0837916    .056428     1.48   0.138    -.0268053    .1943885
             |
     1.game2 |   .0562097    .048324     1.16   0.245    -.0385036     .150923
             |
       order |
large first  |  -.1273457   .0421324    -3.02   0.003    -.2099237   -.0447677
         sex |    .008071   .1027299     0.08   0.937    -.1932759    .2094179
    duration |  -.0055691   .0180389    -0.31   0.758    -.0409246    .0297865
  response_t |  -.0266107   .0115976    -2.29   0.022    -.0493416   -.0038798
   wrong_ans |  -.0355024   .0278012    -1.28   0.202    -.0899918    .0189869
------------------------------------------------------------------------------
Note: dy/dx for factor levels is the discrete change from the base level.

.         test 2.country=3.country

 ( 1)  2.country - 3.country = 0

           chi2(  1) =    1.65
         Prob > chi2 =    0.1994

.         eststo reg14

. 
.         estout * using output6.tex,  replace cells(b(star fmt(3)) se(par fmt(3))) style(tex) label varlabels(1.order "Order 12-12-2-2"  1.game2 "$2^{nd}$ Supergam
> e" duration "Duration" wrong_ans "Incorrect Answers" _cons Constant response_t "Response Time"   1.sex "Male"  sex "Male") collabels(,none) stats(N, labels("N") f
> mt(0 3)) prefoot(\hline) starlevels(* 0.10 ** 0.05 *** 0.01) posthead(\hline) margin(p) nobaselevel
(file output6.tex not found)
(output written to output6.tex)

. 
. 
.         est clear

.         glm  outcome   i.country    i.game2   i.order  i.game5 $controls if treat==1, cluster(sessionID) link(logit) family(binomial) robust nolog 
note: outcome has noninteger values

Generalized linear models                         Number of obs   =        112
Optimization     : ML                             Residual df     =        105
                                                  Scale parameter =          1
Deviance         =  19.03385113                   (1/df) Deviance =   .1812748
Pearson          =  17.17958375                   (1/df) Pearson  =   .1636151

Variance function: V(u) = u*(1-u/1)               [Binomial]
Link function    : g(u) = ln(u/(1-u))             [Logit]

                                                  AIC             =   1.042435
Log pseudolikelihood = -51.37635117               BIC             =  -476.4085

                              (Std. err. adjusted for 8 clusters in sessionID)
------------------------------------------------------------------------------
             |               Robust
     outcome | Coefficient  std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
     country |
     Middle  |   .1045919   .2130675     0.49   0.624    -.3130127    .5221966
     Advan.  |   .2089973   .2280993     0.92   0.360    -.2380691    .6560638
             |
     1.game2 |  -.1167688   .1292471    -0.90   0.366    -.3700884    .1365508
             |
       order |
large first  |  -.8463043   .2826188    -2.99   0.003    -1.400227   -.2923816
     1.game5 |  -.1559759   .2231322    -0.70   0.485    -.5933069    .2813552
         sex |   .6142675   .4301983     1.43   0.153    -.2289057    1.457441
    duration |   .1402066   .0580894     2.41   0.016     .0263534    .2540598
  response_t |   .0100262    .117349     0.09   0.932    -.2199736     .240026
   wrong_ans |  -.0275916   .0479778    -0.58   0.565    -.1216263    .0664432
       _cons |  -.3237058   .2430947    -1.33   0.183    -.8001626    .1527511
------------------------------------------------------------------------------

.         margins, dydx(*) at((base) _factor (asobs) $controls ) post

Average marginal effects                                   Number of obs = 112
Model VCE: Robust

Expression: Predicted mean outcome, predict()
dy/dx wrt:  2.country 3.country 1.game2 1.order 1.game5 sex duration response_t wrong_ans
At: country = 1
    game2   = 0
    order   = 0
    game5   = 0

------------------------------------------------------------------------------
             |            Delta-method
             |      dy/dx   std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
     country |
     Middle  |   .0258936   .0526331     0.49   0.623    -.0772654    .1290527
     Advan.  |   .0516854   .0561264     0.92   0.357    -.0583203    .1616911
             |
     1.game2 |  -.0288057   .0319736    -0.90   0.368    -.0914729    .0338614
             |
       order |
large first  |  -.1956467   .0612877    -3.19   0.001    -.3157684   -.0755251
     1.game5 |  -.0384219   .0547632    -0.70   0.483    -.1457559     .068912
         sex |   .1519679   .1052153     1.44   0.149    -.0542504    .3581862
    duration |   .0346867   .0142844     2.43   0.015     .0066898    .0626836
  response_t |   .0024805   .0290233     0.09   0.932    -.0544041     .059365
   wrong_ans |  -.0068261   .0118591    -0.58   0.565    -.0300694    .0164173
------------------------------------------------------------------------------
Note: dy/dx for factor levels is the discrete change from the base level.

.         test 2.country=3.country

 ( 1)  2.country - 3.country = 0

           chi2(  1) =    0.16
         Prob > chi2 =    0.6902

.         eststo reg11

. 
.         glm  outcome   i.country  i.game2   i.order   i.game5 $controls if treat==2, cluster(sessionID) link(logit) family(binomial) robust nolog 
note: outcome has noninteger values

Generalized linear models                         Number of obs   =        114
Optimization     : ML                             Residual df     =        107
                                                  Scale parameter =          1
Deviance         =  18.00181378                   (1/df) Deviance =   .1682413
Pearson          =  16.48016439                   (1/df) Pearson  =   .1540202

Variance function: V(u) = u*(1-u/1)               [Binomial]
Link function    : g(u) = ln(u/(1-u))             [Logit]

                                                  AIC             =    1.02484
Log pseudolikelihood = -51.41589851               BIC             =  -488.7714

                              (Std. err. adjusted for 8 clusters in sessionID)
------------------------------------------------------------------------------
             |               Robust
     outcome | Coefficient  std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
     country |
     Middle  |  -.0369843   .2593199    -0.14   0.887     -.545242    .4712735
     Advan.  |   .2464636   .2177749     1.13   0.258    -.1803674    .6732945
             |
     1.game2 |  -.4779059   .1270489    -3.76   0.000    -.7269171   -.2288947
             |
       order |
large first  |  -.6087052   .2938746    -2.07   0.038    -1.184689   -.0327215
     1.game5 |  -.4916549   .3165944    -1.55   0.120    -1.112168    .1288588
         sex |   .3431741   .3088161     1.11   0.266    -.2620944    .9484426
    duration |  -.0793451   .0775106    -1.02   0.306    -.2312631    .0725729
  response_t |  -.1000238   .1472944    -0.68   0.497    -.3887155     .188668
   wrong_ans |  -.3012219   .0880616    -3.42   0.001    -.4738195   -.1286243
       _cons |  -.2870133   .4110028    -0.70   0.485    -1.092564    .5185375
------------------------------------------------------------------------------

.         margins, dydx(*) at((base) _factor (asobs) $controls ) post

Average marginal effects                                   Number of obs = 114
Model VCE: Robust

Expression: Predicted mean outcome, predict()
dy/dx wrt:  2.country 3.country 1.game2 1.order 1.game5 sex duration response_t wrong_ans
At: country = 1
    game2   = 0
    order   = 0
    game5   = 0

------------------------------------------------------------------------------
             |            Delta-method
             |      dy/dx   std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
     country |
     Middle  |  -.0090411   .0634368    -0.14   0.887     -.133375    .1152927
     Advan.  |   .0600207   .0527794     1.14   0.255     -.043425    .1634664
             |
     1.game2 |  -.1146528   .0318457    -3.60   0.000    -.1770692   -.0522365
             |
       order |
large first  |   -.144414   .0700232    -2.06   0.039     -.281657   -.0071711
     1.game5 |  -.1178268   .0750653    -1.57   0.116    -.2649521    .0292985
         sex |   .0839097   .0752295     1.12   0.265    -.0635374    .2313567
    duration |  -.0194007   .0189877    -1.02   0.307    -.0566159    .0178145
  response_t |  -.0244569   .0360008    -0.68   0.497    -.0950171    .0461034
   wrong_ans |  -.0736519   .0209844    -3.51   0.000    -.1147805   -.0325233
------------------------------------------------------------------------------
Note: dy/dx for factor levels is the discrete change from the base level.

.         test 2.country=3.country

 ( 1)  2.country - 3.country = 0

           chi2(  1) =    2.05
         Prob > chi2 =    0.1523

.         eststo reg12

. 
.         glm  outcome   i.country  i.game2   i.order   i.game5 $controls if treat==3, cluster(sessionID) link(logit) family(binomial) robust nolog 
note: outcome has noninteger values

Generalized linear models                         Number of obs   =        113
Optimization     : ML                             Residual df     =        106
                                                  Scale parameter =          1
Deviance         =  20.79699834                   (1/df) Deviance =   .1961981
Pearson          =  19.80748472                   (1/df) Pearson  =   .1868631

Variance function: V(u) = u*(1-u/1)               [Binomial]
Link function    : g(u) = ln(u/(1-u))             [Logit]

                                                  AIC             =    1.02663
Log pseudolikelihood = -51.00457848               BIC             =  -480.3061

                              (Std. err. adjusted for 8 clusters in sessionID)
------------------------------------------------------------------------------
             |               Robust
     outcome | Coefficient  std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
     country |
     Middle  |  -.0531949    .188949    -0.28   0.778    -.4235281    .3171384
     Advan.  |   .3839862   .1291491     2.97   0.003     .1308586    .6371138
             |
     1.game2 |   .0570385   .1680436     0.34   0.734    -.2723209    .3863978
             |
       order |
large first  |    .086078   .3908901     0.22   0.826    -.6800526    .8522085
     1.game5 |     -.1598   .3096145    -0.52   0.606    -.7666333    .4470333
         sex |   .1415443   .2873557     0.49   0.622    -.4216625    .7047512
    duration |  -.0772726   .0771047    -1.00   0.316    -.2283951    .0738499
  response_t |   .1091086   .0746039     1.46   0.144    -.0371124    .2553296
   wrong_ans |  -.0212937    .111443    -0.19   0.848    -.2397181    .1971306
       _cons |  -.9342818   .4034635    -2.32   0.021    -1.725056   -.1435079
------------------------------------------------------------------------------

.         margins, dydx(*) at((base) _factor (asobs) $controls ) post

Average marginal effects                                   Number of obs = 113
Model VCE: Robust

Expression: Predicted mean outcome, predict()
dy/dx wrt:  2.country 3.country 1.game2 1.order 1.game5 sex duration response_t wrong_ans
At: country = 1
    game2   = 0
    order   = 0
    game5   = 0

------------------------------------------------------------------------------
             |            Delta-method
             |      dy/dx   std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
     country |
     Middle  |  -.0108344   .0384502    -0.28   0.778    -.0861953    .0645266
     Advan.  |   .0847575   .0359071     2.36   0.018     .0143807    .1551342
             |
     1.game2 |   .0118836   .0353184     0.34   0.737    -.0573393    .0811064
             |
       order |
large first  |   .0180366   .0808191     0.22   0.823     -.140366    .1764392
     1.game5 |  -.0317978   .0626776    -0.51   0.612    -.1546435     .091048
         sex |   .0291513   .0597369     0.49   0.626    -.0879309    .1462335
    duration |  -.0159144   .0170602    -0.93   0.351    -.0493518    .0175229
  response_t |   .0224711   .0151658     1.48   0.138    -.0072533    .0521956
   wrong_ans |  -.0043855   .0233771    -0.19   0.851    -.0502037    .0414328
------------------------------------------------------------------------------
Note: dy/dx for factor levels is the discrete change from the base level.

.         test 2.country=3.country

 ( 1)  2.country - 3.country = 0

           chi2(  1) =    4.50
         Prob > chi2 =    0.0339

.         eststo reg13

. 
.         glm  outcome   i.country  i.game2   i.order   i.game5 $controls if treat==4, cluster(sessionID) link(logit) family(binomial) robust nolog 
note: outcome has noninteger values

Generalized linear models                         Number of obs   =        115
Optimization     : ML                             Residual df     =        108
                                                  Scale parameter =          1
Deviance         =  23.75491979                   (1/df) Deviance =    .219953
Pearson          =  21.28988459                   (1/df) Pearson  =   .1971286

Variance function: V(u) = u*(1-u/1)               [Binomial]
Link function    : g(u) = ln(u/(1-u))             [Logit]

                                                  AIC             =   1.072117
Log pseudolikelihood = -54.64671143               BIC             =  -488.6978

                              (Std. err. adjusted for 8 clusters in sessionID)
------------------------------------------------------------------------------
             |               Robust
     outcome | Coefficient  std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
     country |
     Middle  |   .0342724   .2280644     0.15   0.881    -.4127255    .4812703
     Advan.  |   .3530412   .2183121     1.62   0.106    -.0748426     .780925
             |
     1.game2 |   .2310222   .1928885     1.20   0.231    -.1470323    .6090767
             |
       order |
large first  |   -.473226   .1902595    -2.49   0.013    -.8461278   -.1003242
     1.game5 |  -.2048491    .201248    -1.02   0.309     -.599288    .1895897
         sex |  -.0594176   .4111781    -0.14   0.885    -.8653118    .7464766
    duration |  -.0075987   .0583892    -0.13   0.896    -.1220394     .106842
  response_t |  -.1189231   .0499826    -2.38   0.017    -.2168872   -.0209591
   wrong_ans |  -.1343674   .1090824    -1.23   0.218     -.348165    .0794301
       _cons |  -.2456689   .2317064    -1.06   0.289     -.699805    .2084673
------------------------------------------------------------------------------

.         margins, dydx(*) at((base) _factor (asobs) $controls ) post

Average marginal effects                                   Number of obs = 115
Model VCE: Robust

Expression: Predicted mean outcome, predict()
dy/dx wrt:  2.country 3.country 1.game2 1.order 1.game5 sex duration response_t wrong_ans
At: country = 1
    game2   = 0
    order   = 0
    game5   = 0

------------------------------------------------------------------------------
             |            Delta-method
             |      dy/dx   std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
     country |
     Middle  |   .0082911   .0552404     0.15   0.881    -.0999782    .1165603
     Advan.  |   .0868053   .0541893     1.60   0.109    -.0194038    .1930144
             |
     1.game2 |   .0565611   .0479561     1.18   0.238    -.0374311    .1505533
             |
       order |
large first  |  -.1080138   .0415097    -2.60   0.009    -.1893714   -.0266563
     1.game5 |   -.048443   .0467432    -1.04   0.300     -.140058     .043172
         sex |  -.0143351   .0991967    -0.14   0.885     -.208757    .1800868
    duration |  -.0018333    .014077    -0.13   0.896    -.0294236    .0257571
  response_t |  -.0286914   .0121924    -2.35   0.019     -.052588   -.0047948
   wrong_ans |  -.0324175    .026368    -1.23   0.219    -.0840979    .0192629
------------------------------------------------------------------------------
Note: dy/dx for factor levels is the discrete change from the base level.

.         test 2.country=3.country

 ( 1)  2.country - 3.country = 0

           chi2(  1) =    1.91
         Prob > chi2 =    0.1670

.         eststo reg14

. 
.         estout * using output7.tex,  replace cells(b(star fmt(3)) se(par fmt(3))) style(tex) label varlabels(1.order "Order 12-12-2-2"  1.game2 "$2^{nd}$ Supergam
> e" duration "Duration" wrong_ans "Incorrect Answers" _cons Constant response_t "Response Time"   1.sex "Male"  sex "Male") collabels(,none) stats(N, labels("N") f
> mt(0 3)) prefoot(\hline) starlevels(* 0.10 ** 0.05 *** 0.01) posthead(\hline) margin(p) nobaselevel
(file output7.tex not found)
(output written to output7.tex)

. 
. restore

. 
. 
. 
. *======================================================================================
. *       COOPERATION  in FIXED PAIRS (PHASE 1  & PHASE 2 separately)     Unit of obs = 1 Economy 
. *======================================================================================
. use $data 

. preserve

.         graph drop _all

.         keep if groupsize==2    
(49,784 observations deleted)

.         keep if treat <5
(4,696 observations deleted)

.         
.         macro define controls "sex duration response_t wrong_ans"               

.         collapse outcome   $controls, by (treatment sessionID game  groupID order )

.         center response_t wrong_ans duration, inplace  standardize 
(modified variables: response_t wrong_ans duration)

.         gen game2=(game==2 | game==4)

. 
. *** GLM regression      
.         est clear

.         glm  outcome   i.treat   i.game2   i.order  $controls if game<5, cluster(sessionID) link(logit) family(binomial) robust nolog 
note: outcome has noninteger values

Generalized linear models                         Number of obs   =        768
Optimization     : ML                             Residual df     =        758
                                                  Scale parameter =          1
Deviance         =  493.5115083                   (1/df) Deviance =   .6510706
Pearson          =  466.8297248                   (1/df) Pearson  =   .6158703

Variance function: V(u) = u*(1-u/1)               [Binomial]
Link function    : g(u) = ln(u/(1-u))             [Logit]

                                                  AIC             =   .9803768
Log pseudolikelihood = -366.4646936               BIC             =  -4542.481

                             (Std. err. adjusted for 32 clusters in sessionID)
------------------------------------------------------------------------------
             |               Robust
     outcome | Coefficient  std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
   treatment |
   Converge  |  -.1233114   .2577948    -0.48   0.632    -.6285799    .3819572
    Diverge  |      -.552   .2938526    -1.88   0.060    -1.127941    .0239406
   Neutral+  |  -.3134405   .2087976    -1.50   0.133    -.7226764    .0957953
             |
     1.game2 |   .5493726   .0877338     6.26   0.000     .3774174    .7213277
             |
       order |
large first  |   .3178937   .1839843     1.73   0.084     -.042709    .6784964
         sex |   .8500476   .1708415     4.98   0.000     .5152045    1.184891
    duration |  -.0643687   .0599409    -1.07   0.283    -.1818508    .0531134
  response_t |  -.2043386    .079562    -2.57   0.010    -.3602772      -.0484
   wrong_ans |  -.4577981   .0755792    -6.06   0.000    -.6059305   -.3096656
       _cons |   .4790378   .2059505     2.33   0.020     .0753823    .8826934
------------------------------------------------------------------------------

.         margins, dydx(*) at((base) _factor (asobs) $controls ) post

Average marginal effects                                   Number of obs = 768
Model VCE: Robust

Expression: Predicted mean outcome, predict()
dy/dx wrt:  2.treatment 3.treatment 4.treatment 1.game2 1.order sex duration response_t wrong_ans
At: treatment = 1
    game2     = 0
    order     = 0

------------------------------------------------------------------------------
             |            Delta-method
             |      dy/dx   std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
   treatment |
   Converge  |  -.0250432   .0524633    -0.48   0.633    -.1278694     .077783
    Diverge  |  -.1182721   .0646954    -1.83   0.068    -.2450728    .0085286
   Neutral+  |  -.0653708   .0438237    -1.49   0.136    -.1512637    .0205221
             |
     1.game2 |   .0984123   .0173406     5.68   0.000     .0644254    .1323993
             |
       order |
large first  |   .0597554   .0338464     1.77   0.077    -.0065823    .1260931
         sex |      .1693   .0374698     4.52   0.000     .0958604    .2427395
    duration |    -.01282   .0117212    -1.09   0.274    -.0357932    .0101532
  response_t |  -.0406972   .0160943    -2.53   0.011    -.0722414   -.0091529
   wrong_ans |  -.0911775   .0146392    -6.23   0.000    -.1198697   -.0624852
------------------------------------------------------------------------------
Note: dy/dx for factor levels is the discrete change from the base level.

.         test 2.treatment=3.treatment

 ( 1)  2.treatment - 3.treatment = 0

           chi2(  1) =    1.90
         Prob > chi2 =    0.1681

.         test 2.treatment=4.treatment

 ( 1)  2.treatment - 4.treatment = 0

           chi2(  1) =    0.57
         Prob > chi2 =    0.4485

.         test 3.treatment=4.treatment

 ( 1)  3.treatment - 4.treatment = 0

           chi2(  1) =    0.77
         Prob > chi2 =    0.3805

.         eststo reg1

. 
.         glm  outcome   i.treat    i.order $controls if game==5, cluster(sessionID) link(logit) family(binomial) robust nolog 
note: outcome has noninteger values

Generalized linear models                         Number of obs   =        104
Optimization     : ML                             Residual df     =         95
                                                  Scale parameter =          1
Deviance         =  69.32259944                   (1/df) Deviance =   .7297116
Pearson          =  76.32407005                   (1/df) Pearson  =   .8034113

Variance function: V(u) = u*(1-u/1)               [Binomial]
Link function    : g(u) = ln(u/(1-u))             [Logit]

                                                  AIC             =   1.039161
Log pseudolikelihood = -45.03636235               BIC             =  -371.8945

                             (Std. err. adjusted for 26 clusters in sessionID)
------------------------------------------------------------------------------
             |               Robust
     outcome | Coefficient  std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
   treatment |
   Converge  |  -.5240651   .5790068    -0.91   0.365    -1.658898    .6107675
    Diverge  |  -.2927586   .5991265    -0.49   0.625    -1.467025    .8815078
   Neutral+  |  -.0389002   .6295223    -0.06   0.951    -1.272741    1.194941
             |
       order |
large first  |  -.7455784   .4259136    -1.75   0.080    -1.580354     .089197
         sex |    .486239   .4784907     1.02   0.310    -.4515856    1.424064
    duration |  -.3573878   .1013561    -3.53   0.000    -.5560421   -.1587334
  response_t |  -.0126297   .1967719    -0.06   0.949    -.3982956    .3730362
   wrong_ans |  -.4340466   .2327356    -1.86   0.062    -.8901999    .0221067
       _cons |   1.904398    .531951     3.58   0.000     .8617929    2.947002
------------------------------------------------------------------------------

.         margins, dydx(*) at((base) _factor (asobs) $controls ) post

Average marginal effects                                   Number of obs = 104
Model VCE: Robust

Expression: Predicted mean outcome, predict()
dy/dx wrt:  2.treatment 3.treatment 4.treatment 1.order sex duration response_t wrong_ans
At: treatment = 1
    order     = 0

------------------------------------------------------------------------------
             |            Delta-method
             |      dy/dx   std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
   treatment |
   Converge  |  -.0681716   .0733441    -0.93   0.353    -.2119234    .0755801
    Diverge  |  -.0354434   .0717805    -0.49   0.621    -.1761306    .1052438
   Neutral+  |  -.0043395   .0702578    -0.06   0.951    -.1420423    .1333634
             |
       order |
large first  |  -.1035505   .0662402    -1.56   0.118     -.233379     .026278
         sex |   .0535543   .0522733     1.02   0.306    -.0488994    .1560081
    duration |  -.0393627   .0139168    -2.83   0.005    -.0666391   -.0120862
  response_t |   -.001391   .0215823    -0.06   0.949    -.0436916    .0409095
   wrong_ans |  -.0478059   .0305397    -1.57   0.117    -.1076626    .0120508
------------------------------------------------------------------------------
Note: dy/dx for factor levels is the discrete change from the base level.

.         test 2.treatment=3.treatment

 ( 1)  2.treatment - 3.treatment = 0

           chi2(  1) =    0.24
         Prob > chi2 =    0.6228

.         test 2.treatment=4.treatment

 ( 1)  2.treatment - 4.treatment = 0

           chi2(  1) =    1.07
         Prob > chi2 =    0.3020

.         test 3.treatment=4.treatment

 ( 1)  3.treatment - 4.treatment = 0

           chi2(  1) =    0.22
         Prob > chi2 =    0.6358

.         eststo reg2

. 
.         estout * using output8.tex,  replace cells(b(star fmt(3)) se(par fmt(3))) style(tex) label varlabels(1.order "Order 12-12-2-2"  1.game2 "$2^{nd}$ Supergam
> e" duration "Duration" wrong_ans "Incorrect Answers" _cons Constant response_t "Response Time"   1.sex "Male"  sex "Male") collabels(,none) stats(N, labels("N") f
> mt(0 3)) prefoot(\hline) starlevels(* 0.10 ** 0.05 *** 0.01) posthead(\hline) margin(p) nobaselevel
(file output8.tex not found)
(output written to output8.tex)

.                 
. restore

. 
. 
. *===================================================
. *       INTEGRATION GAINS  in PHASE 1  (1 Obs = 1 subject ID)
. *===================================================
. use $data

. preserve

.         keep if game<5
(18,384 observations deleted)

. 
.         collapse choice profit, by(treatment groupsize ID)              

.         reshape wide choice profit, i(ID) j(groupsize)
(j = 2 12)

Data                               Long   ->   Wide
-----------------------------------------------------------------------------
Number of observations            1,728   ->   864         
Number of variables                   5   ->   6           
j variable (2 values)         groupsize   ->   (dropped)
xij variables:
                                 choice   ->   choice2 choice12
                                 profit   ->   profit2 profit12
-----------------------------------------------------------------------------

.         gen temp=profit12-profit2

.         table (treat) (), statistic(mean  temp)  nformat(%9.3f)

------------------------
               |    Mean
---------------+--------
Treatment      |        
  Neutral      |  -0.187
  Converge     |  -0.207
  Diverge      |  -0.096
  Neutral+     |   0.501
  Neutral-Chat |   1.608
  Total        |   0.181
------------------------

.         
. local variable "1 2 3 4 5"

.         foreach i of local variable{
  2.         dis "=== PROFITS in Fixed Pairs vs. Mixed Groups (Phase 1):   Treat = `i' ==="
  3.         signrank profit2=profit12 if treatment==`i'
  4.         }
=== PROFITS in Fixed Pairs vs. Mixed Groups (Phase 1):   Treat = 1 ===

Wilcoxon signed-rank test

        Sign |      Obs   Sum ranks    Expected
-------------+---------------------------------
    Positive |      110       10874        9264
    Negative |       82        7654        9264
        Zero |        0           0           0
-------------+---------------------------------
         All |      192       18528       18528

Unadjusted variance   594440.00
Adjustment for ties        0.00
Adjustment for zeros       0.00
                     ----------
Adjusted variance     594440.00

H0: profit2 = profit12 
         z =  2.088
Prob > |z| = 0.0368
Exact prob = 0.0366
=== PROFITS in Fixed Pairs vs. Mixed Groups (Phase 1):   Treat = 2 ===

Wilcoxon signed-rank test

        Sign |      Obs   Sum ranks    Expected
-------------+---------------------------------
    Positive |      105     10800.5        9264
    Negative |       87      7727.5        9264
        Zero |        0           0           0
-------------+---------------------------------
         All |      192       18528       18528

Unadjusted variance   594440.00
Adjustment for ties       -0.50
Adjustment for zeros       0.00
                     ----------
Adjusted variance     594439.50

H0: profit2 = profit12 
         z =  1.993
Prob > |z| = 0.0463
Exact prob = 0.0461
=== PROFITS in Fixed Pairs vs. Mixed Groups (Phase 1):   Treat = 3 ===

Wilcoxon signed-rank test

        Sign |      Obs   Sum ranks    Expected
-------------+---------------------------------
    Positive |      108     10280.5        9264
    Negative |       84      8247.5        9264
        Zero |        0           0           0
-------------+---------------------------------
         All |      192       18528       18528

Unadjusted variance   594440.00
Adjustment for ties       -0.88
Adjustment for zeros       0.00
                     ----------
Adjusted variance     594439.13

H0: profit2 = profit12 
         z =  1.318
Prob > |z| = 0.1874
Exact prob = 0.1879
=== PROFITS in Fixed Pairs vs. Mixed Groups (Phase 1):   Treat = 4 ===

Wilcoxon signed-rank test

        Sign |      Obs   Sum ranks    Expected
-------------+---------------------------------
    Positive |       84        6592        9264
    Negative |      108       11936        9264
        Zero |        0           0           0
-------------+---------------------------------
         All |      192       18528       18528

Unadjusted variance   594440.00
Adjustment for ties       -0.25
Adjustment for zeros       0.00
                     ----------
Adjusted variance     594439.75

H0: profit2 = profit12 
         z = -3.466
Prob > |z| = 0.0005
Exact prob = 0.0005
=== PROFITS in Fixed Pairs vs. Mixed Groups (Phase 1):   Treat = 5 ===

Wilcoxon signed-rank test

        Sign |      Obs   Sum ranks    Expected
-------------+---------------------------------
    Positive |        1           5        2328
    Negative |       95        4651        2328
        Zero |        0           0           0
-------------+---------------------------------
         All |       96        4656        4656

Unadjusted variance    74884.00
Adjustment for ties       -2.38
Adjustment for zeros       0.00
                     ----------
Adjusted variance      74881.63

H0: profit2 = profit12 
         z = -8.489
Prob > |z| = 0.0000
Exact prob = 0.0000

.         
. restore 

. 
. 
. 
. *============================================================================================================
. *       PAYOFFS :       DO MIXED GROUPS support HIGHER AVERAGE PAYOFFS than PARTNERSHIPS? (Regression ON GAMES 1-4 )
. *============================================================================================================
.         use $data

.         preserve

.         keep if treat<5
(10,008 observations deleted)

.         drop if game==5
(16,512 observations deleted)

. 
.         macro define controls "sex duration duration_lagged response_t wrong_ans"               

.         collapse profit $controls, by(treatment sessionID game groupID groupsize order)

.         
.         gen secondGame=(game==2 | game==4  )

.         center response_t wrong_ans duration duration_lagged, inplace  standardize 
(modified variables: response_t wrong_ans duration duration_lagged)

. 
.         macro define controls "sex duration duration_lagged response_t wrong_ans"               

. 
.         est clear

.         reg  profit   ib2.groupsize i.order i.secondGame $controls if treat==1,  cluster(sessionID)

Linear regression                               Number of obs     =        224
                                                F(6, 7)           =          .
                                                Prob > F          =          .
                                                R-squared         =     0.0888
                                                Root MSE          =     .92085

                                 (Std. err. adjusted for 8 clusters in sessionID)
---------------------------------------------------------------------------------
                |               Robust
         profit | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
----------------+----------------------------------------------------------------
   12.groupsize |  -.1462366   .2345574    -0.62   0.553    -.7008766    .4084035
                |
          order |
   large first  |   .2611785   .0998381     2.62   0.035     .0250989    .4972581
   1.secondGame |   .0859704    .049449     1.74   0.126    -.0309579    .2028988
            sex |   .5808934   .2242753     2.59   0.036     .0505667     1.11122
       duration |   .0623973   .0472339     1.32   0.228    -.0492931    .1740876
duration_lagged |   .1167185   .0550196     2.12   0.072    -.0133823    .2468192
     response_t |   .1024758    .076442     1.34   0.222    -.0782808    .2832324
      wrong_ans |   .0255306   .0650316     0.39   0.706    -.1282448     .179306
          _cons |   5.598927   .1545852    36.22   0.000     5.233391    5.964463
---------------------------------------------------------------------------------

.         eststo reg1

. 
.         reg  profit   ib2.groupsize i.order i.secondGame $controls if treat==2,  cluster(sessionID)

Linear regression                               Number of obs     =        224
                                                F(6, 7)           =          .
                                                Prob > F          =          .
                                                R-squared         =     0.1234
                                                Root MSE          =     .87842

                                 (Std. err. adjusted for 8 clusters in sessionID)
---------------------------------------------------------------------------------
                |               Robust
         profit | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
----------------+----------------------------------------------------------------
   12.groupsize |   -.239561   .0896347    -2.67   0.032    -.4515134   -.0276086
                |
          order |
   large first  |  -.3070867   .0647959    -4.74   0.002    -.4603046   -.1538688
   1.secondGame |   .0763343   .0324587     2.35   0.051    -.0004183    .1530869
            sex |   .0965146   .2857673     0.34   0.745    -.5792177     .772247
       duration |   .0094244   .0398142     0.24   0.820    -.0847212    .1035701
duration_lagged |   .1006653    .055142     1.83   0.111    -.0297249    .2310554
     response_t |  -.0537841   .0824036    -0.65   0.535    -.2486376    .1410695
      wrong_ans |  -.2638253   .0878002    -3.00   0.020    -.4714398   -.0562108
          _cons |   6.059035   .1762553    34.38   0.000     5.642257    6.475812
---------------------------------------------------------------------------------

.         eststo reg2

.         
.         reg  profit   ib2.groupsize i.order i.secondGame $controls if treat==3,  cluster(sessionID)

Linear regression                               Number of obs     =        224
                                                F(6, 7)           =          .
                                                Prob > F          =          .
                                                R-squared         =     0.0861
                                                Root MSE          =     .87328

                                 (Std. err. adjusted for 8 clusters in sessionID)
---------------------------------------------------------------------------------
                |               Robust
         profit | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
----------------+----------------------------------------------------------------
   12.groupsize |   -.107769   .1707307    -0.63   0.548    -.5114829     .295945
                |
          order |
   large first  |  -.0660903    .229528    -0.29   0.782    -.6088378    .4766572
   1.secondGame |   .1617916    .057286     2.82   0.026     .0263318    .2972513
            sex |   .2482146   .1415962     1.75   0.123    -.0866072    .5830365
       duration |   .0116866   .0423827     0.28   0.791    -.0885325    .1119057
duration_lagged |   .2045021   .0516707     3.96   0.005     .0823202    .3266839
     response_t |  -.0756525   .0452178    -1.67   0.138    -.1825757    .0312707
      wrong_ans |  -.1351777   .0516696    -2.62   0.035    -.2573569   -.0129986
          _cons |   5.632069   .2190464    25.71   0.000     5.114106    6.150031
---------------------------------------------------------------------------------

.         eststo reg3

. 
.         reg  profit   ib2.groupsize i.order i.secondGame $controls if treat==4,  cluster(sessionID)

Linear regression                               Number of obs     =        224
                                                F(6, 7)           =          .
                                                Prob > F          =          .
                                                R-squared         =     0.0943
                                                Root MSE          =     1.0078

                                 (Std. err. adjusted for 8 clusters in sessionID)
---------------------------------------------------------------------------------
                |               Robust
         profit | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
----------------+----------------------------------------------------------------
   12.groupsize |   .5127343   .2005146     2.56   0.038     .0385926     .986876
                |
          order |
   large first  |   .0637545   .0746256     0.85   0.421    -.1127069    .2402159
   1.secondGame |   .1781823   .0833591     2.14   0.070    -.0189306    .3752951
            sex |    .405059   .1350782     3.00   0.020     .0856497    .7244683
       duration |    -.01464   .0572724    -0.26   0.806    -.1500678    .1207878
duration_lagged |   .0688409   .0371462     1.85   0.106    -.0189959    .1566777
     response_t |  -.0987707   .1354066    -0.73   0.489    -.4189565     .221415
      wrong_ans |  -.1160058    .091086    -1.27   0.243    -.3313898    .0993783
          _cons |   5.641023   .1134745    49.71   0.000     5.372698    5.909347
---------------------------------------------------------------------------------

.         eststo reg4

. 
.         estout *  using output9.tex,  replace cells(b(star fmt(3)) se(par fmt(3))) style(tex) label varlabels(game Supergame  duration "Supergame duration" wrong_
> ans "Incorrect Answers" _cons Constant male Male response_t "Response Time" 1.order "12-12-2-2"   1.sex "Male"     1.secondGame "$2^{nd}$ game") collabels(,none) 
> stats(N r2 r2_a  , labels("N" "R$^2$" "adj R$^2$" ) fmt(0 3)) prefoot(\hline) starlevels(* 0.10 ** 0.05 *** 0.01) posthead(\hline) margin(p) nobaselevel    
(file output9.tex not found)
(output written to output9.tex)

. 
.         restore

. 
. 
. 
. *==========================================================
. *       TABLE 3 :   INTEGRATION GAINS in PHASE 1    +  Stat tests  (1 Obs = 1 type in a session)
. *==========================================================
. use $data

. preserve

.         keep if  game<5
(18,384 observations deleted)

. 
.         collapse profit, by(treatment session groupsize country)                

.         reshape wide profit, i(treatment session country) j(groupsize)
(j = 2 12)

Data                               Long   ->   Wide
-----------------------------------------------------------------------------
Number of observations              216   ->   108         
Number of variables                   5   ->   5           
j variable (2 values)         groupsize   ->   (dropped)
xij variables:
                                 profit   ->   profit2 profit12
-----------------------------------------------------------------------------

.         gen temp=profit12-profit2

.         table (treat) (country), statistic(mean  temp)  nformat(%9.3f) totals(treat)

----------------------------------------------------
               |                Country             
               |  Disadv.   Middle   Advan.    Total
---------------+------------------------------------
Treatment      |                                    
  Neutral      |    0.387   -0.163   -0.784   -0.187
  Converge     |    0.573   -0.239   -0.954   -0.207
  Diverge      |   -0.194    0.056   -0.149   -0.096
  Neutral+     |    0.980    0.718   -0.195    0.501
  Neutral-Chat |    1.666    1.535    1.623    1.608
----------------------------------------------------

.         
. local variable "1 2 3 4 "

.         foreach i of local variable{
  2.         dis "=== DISADV Treat = `i' ==="
  3.         signrank profit2=profit12 if treatment==`i' & country==1
  4.         dis "=== MIDDLE   - Treat = `i' ==="
  5.         signrank profit2=profit12 if treatment==`i' & country==2
  6.         dis "=== DISADVANT - Treat = `i' ==="
  7.         signrank profit2=profit12 if treatment==`i' & country==3
  8.         }
=== DISADV Treat = 1 ===

Wilcoxon signed-rank test

        Sign |      Obs   Sum ranks    Expected
-------------+---------------------------------
    Positive |        3           9          18
    Negative |        5          27          18
        Zero |        0           0           0
-------------+---------------------------------
         All |        8          36          36

Unadjusted variance       51.00
Adjustment for ties        0.00
Adjustment for zeros       0.00
                     ----------
Adjusted variance         51.00

H0: profit2 = profit12 
         z = -1.260
Prob > |z| = 0.2076
Exact prob = 0.2500
=== MIDDLE   - Treat = 1 ===

Wilcoxon signed-rank test

        Sign |      Obs   Sum ranks    Expected
-------------+---------------------------------
    Positive |        4          23          18
    Negative |        4          13          18
        Zero |        0           0           0
-------------+---------------------------------
         All |        8          36          36

Unadjusted variance       51.00
Adjustment for ties        0.00
Adjustment for zeros       0.00
                     ----------
Adjusted variance         51.00

H0: profit2 = profit12 
         z =  0.700
Prob > |z| = 0.4838
Exact prob = 0.5469
=== DISADVANT - Treat = 1 ===

Wilcoxon signed-rank test

        Sign |      Obs   Sum ranks    Expected
-------------+---------------------------------
    Positive |        4          26          18
    Negative |        4          10          18
        Zero |        0           0           0
-------------+---------------------------------
         All |        8          36          36

Unadjusted variance       51.00
Adjustment for ties        0.00
Adjustment for zeros       0.00
                     ----------
Adjusted variance         51.00

H0: profit2 = profit12 
         z =  1.120
Prob > |z| = 0.2626
Exact prob = 0.3125
=== DISADV Treat = 2 ===

Wilcoxon signed-rank test

        Sign |      Obs   Sum ranks    Expected
-------------+---------------------------------
    Positive |        1           3          18
    Negative |        7          33          18
        Zero |        0           0           0
-------------+---------------------------------
         All |        8          36          36

Unadjusted variance       51.00
Adjustment for ties        0.00
Adjustment for zeros       0.00
                     ----------
Adjusted variance         51.00

H0: profit2 = profit12 
         z = -2.100
Prob > |z| = 0.0357
Exact prob = 0.0391
=== MIDDLE   - Treat = 2 ===

Wilcoxon signed-rank test

        Sign |      Obs   Sum ranks    Expected
-------------+---------------------------------
    Positive |        6          26          18
    Negative |        2          10          18
        Zero |        0           0           0
-------------+---------------------------------
         All |        8          36          36

Unadjusted variance       51.00
Adjustment for ties        0.00
Adjustment for zeros       0.00
                     ----------
Adjusted variance         51.00

H0: profit2 = profit12 
         z =  1.120
Prob > |z| = 0.2626
Exact prob = 0.3125
=== DISADVANT - Treat = 2 ===

Wilcoxon signed-rank test

        Sign |      Obs   Sum ranks    Expected
-------------+---------------------------------
    Positive |        7          34          18
    Negative |        1           2          18
        Zero |        0           0           0
-------------+---------------------------------
         All |        8          36          36

Unadjusted variance       51.00
Adjustment for ties        0.00
Adjustment for zeros       0.00
                     ----------
Adjusted variance         51.00

H0: profit2 = profit12 
         z =  2.240
Prob > |z| = 0.0251
Exact prob = 0.0234
=== DISADV Treat = 3 ===

Wilcoxon signed-rank test

        Sign |      Obs   Sum ranks    Expected
-------------+---------------------------------
    Positive |        5          30          18
    Negative |        3           6          18
        Zero |        0           0           0
-------------+---------------------------------
         All |        8          36          36

Unadjusted variance       51.00
Adjustment for ties        0.00
Adjustment for zeros       0.00
                     ----------
Adjusted variance         51.00

H0: profit2 = profit12 
         z =  1.680
Prob > |z| = 0.0929
Exact prob = 0.1094
=== MIDDLE   - Treat = 3 ===

Wilcoxon signed-rank test

        Sign |      Obs   Sum ranks    Expected
-------------+---------------------------------
    Positive |        4          15          18
    Negative |        4          21          18
        Zero |        0           0           0
-------------+---------------------------------
         All |        8          36          36

Unadjusted variance       51.00
Adjustment for ties        0.00
Adjustment for zeros       0.00
                     ----------
Adjusted variance         51.00

H0: profit2 = profit12 
         z = -0.420
Prob > |z| = 0.6744
Exact prob = 0.7422
=== DISADVANT - Treat = 3 ===

Wilcoxon signed-rank test

        Sign |      Obs   Sum ranks    Expected
-------------+---------------------------------
    Positive |        4          21          18
    Negative |        4          15          18
        Zero |        0           0           0
-------------+---------------------------------
         All |        8          36          36

Unadjusted variance       51.00
Adjustment for ties        0.00
Adjustment for zeros       0.00
                     ----------
Adjusted variance         51.00

H0: profit2 = profit12 
         z =  0.420
Prob > |z| = 0.6744
Exact prob = 0.7422
=== DISADV Treat = 4 ===

Wilcoxon signed-rank test

        Sign |      Obs   Sum ranks    Expected
-------------+---------------------------------
    Positive |        0           0          18
    Negative |        8          36          18
        Zero |        0           0           0
-------------+---------------------------------
         All |        8          36          36

Unadjusted variance       51.00
Adjustment for ties        0.00
Adjustment for zeros       0.00
                     ----------
Adjusted variance         51.00

H0: profit2 = profit12 
         z = -2.521
Prob > |z| = 0.0117
Exact prob = 0.0078
=== MIDDLE   - Treat = 4 ===

Wilcoxon signed-rank test

        Sign |      Obs   Sum ranks    Expected
-------------+---------------------------------
    Positive |        1           3          18
    Negative |        7          33          18
        Zero |        0           0           0
-------------+---------------------------------
         All |        8          36          36

Unadjusted variance       51.00
Adjustment for ties        0.00
Adjustment for zeros       0.00
                     ----------
Adjusted variance         51.00

H0: profit2 = profit12 
         z = -2.100
Prob > |z| = 0.0357
Exact prob = 0.0391
=== DISADVANT - Treat = 4 ===

Wilcoxon signed-rank test

        Sign |      Obs   Sum ranks    Expected
-------------+---------------------------------
    Positive |        6          24          18
    Negative |        2          12          18
        Zero |        0           0           0
-------------+---------------------------------
         All |        8          36          36

Unadjusted variance       51.00
Adjustment for ties        0.00
Adjustment for zeros       0.00
                     ----------
Adjusted variance         51.00

H0: profit2 = profit12 
         z =  0.840
Prob > |z| = 0.4008
Exact prob = 0.4609

.         
. restore 

. 
. 
. *==========================================================
. *               FIGURE  --      DISTRIBUTION OF VOTES   (1 obs = 1 session)
. *==========================================================
. use $data 

. preserve

.         drop vote

.         keep if treat<5
(10,008 observations deleted)

.                 
.         collapse vote*, by(treatment sessionID)

.         count if treat==1
  8

. 
.         collapse vote1 vote2 vote3 (sem) sem1=vote1  sem2=vote2  sem3=vote3, by(treatment)

.         reshape long vote sem, i(treatment) j(voteNEW)
(j = 1 2 3)

Data                               Wide   ->   Long
-----------------------------------------------------------------------------
Number of observations                4   ->   12          
Number of variables                   7   ->   4           
j variable (3 values)                     ->   voteNEW
xij variables:
                      vote1 vote2 vote3   ->   vote
                         sem1 sem2 sem3   ->   sem
-----------------------------------------------------------------------------

.                                 
.         gen hi_sem=vote + sem

.         gen low_sem=vote - sem

.                         
.         gen position = voteNEW if treatment==3
(9 missing values generated)

.         replace position = voteNEW+4 if treatment==1
(3 real changes made)

.         replace position = voteNEW+8 if treatment==2
(3 real changes made)

.         replace position = voteNEW+12 if treatment==4
(3 real changes made)

.                 replace position = position -0.25 if voteNEW==2
(4 real changes made)

.                 replace position = position - 0.5 if voteNEW==3
(4 real changes made)

.         
.         sort position

.         list position treatment voteNEW, sepby(treatment)       

     +-------------------------------+
     | position   treatm~t   voteNEW |
     |-------------------------------|
  1. |        1    Diverge         1 |
  2. |     1.75    Diverge         2 |
  3. |      2.5    Diverge         3 |
     |-------------------------------|
  4. |        5    Neutral         1 |
  5. |     5.75    Neutral         2 |
  6. |      6.5    Neutral         3 |
     |-------------------------------|
  7. |        9   Converge         1 |
  8. |     9.75   Converge         2 |
  9. |     10.5   Converge         3 |
     |-------------------------------|
 10. |       13   Neutral+         1 |
 11. |    13.75   Neutral+         2 |
 12. |     14.5   Neutral+         3 |
     +-------------------------------+

.         
.         gen avg=round(vote, 0.01)

.                                 
.         graph twoway    (bar vote position if voteNEW==1,  fcolor(gs4) lcolor(black))    (bar vote position if voteNEW==2, fcolor(gs12) lcolor(black))          (b
> ar vote position if voteNEW==3, fcolor(gs16) lcolor(black))        (rcap hi_sem low_sem position, bcolor(black) lw(thin)),     xlabel(1.75 "Diverge"  5.75 "Neutra
> l"  9.75  "Converge"  13.75  "Neutral+", labsize(medsmall) )         xtitle("") ytitle("Relative frequency", size(medsmall))                        yscale(range(1
> .00)) ylabel(0(0.2)1, labsize(medsmall) nogrid)           legend(order(1 "Leave" 2 "Exclude" 3 "Stay")  size(medsmall) region(lcolor(white))   ring(0) pos(10) row
> s(1)   symxsize(*0.4))   graphregion(color(white)fcolor(white))   plotregion(margin(zero)) scale(1.4) 

. 
.         graph export votes.eps, as(eps) preview(off) replace
(file votes.eps not found)
file votes.eps saved as EPS format

.         
.         table (treat) (voteNEW), statistic(mean  avg)  nformat(%9.3f) nototals

-----------------------------------
           |         voteNEW       
           |      1       2       3
-----------+-----------------------
Treatment  |                       
  Neutral  |  0.470   0.330   0.200
  Converge |  0.470   0.290   0.240
  Diverge  |  0.460   0.380   0.170
  Neutral+ |  0.310   0.380   0.310
-----------------------------------

. 
. restore

. 
. 
. 
. *============================================================================================
. *       STATISTICAL ANALYSIS  ---  VOTING within a TREATMENT  at Session level  (8 independent observations)
. *============================================================================================
.         use $data 

.         preserve

.         
. *       Use only the last game (since votes are cast in game 4, but reported in all games in the dataset)
.         drop if game!=5
(71,592 observations deleted)

.         drop vote

.         label drop countryl

.         
. **      Collapse by SESSION  (vote1=Leave, vote2=Exclude, vote3=Stay)
.         collapse vote1 vote2 vote3, by(treatment sessionID)

.         count if treat==1
  8

.         
. ** 1 obs = 1 session. SIGNRANK TEST assume symmetry of diferences, which "signtest" does not.
.         local variable "1 2 3 4 5"

.         foreach i of local variable{
  2.         dis "===Treat = `i' ==="
  3. 
.         dis "=== Leave vs. Exclude ==="
  4.         signtest  vote1=vote2 if treat==`i' 
  5. 
.         dis "=== Exclude vs. Stay ==="
  6.         signtest  vote2=vote3 if treat==`i' 
  7.         
.         dis "=== Leave vs. Stay ==="
  8.         signtest  vote1=vote3 if treat==`i' 
  9.                 }
===Treat = 1 ===
=== Leave vs. Exclude ===

Sign test

        Sign |    Observed    Expected
-------------+------------------------
    Positive |           7           4
    Negative |           1           4
        Zero |           0           0
-------------+------------------------
         All |           8           8

One-sided tests:
  H0: median of vote1 - vote2  = 0 vs.
  Ha: median of vote1 - vote2  > 0
      Pr(#positive >= 7) =
         Binomial(n = 8, x >= 7, p = 0.5) = 0.0352

  H0: median of vote1 - vote2  = 0 vs.
  Ha: median of vote1 - vote2  < 0
      Pr(#negative >= 1) =
         Binomial(n = 8, x >= 1, p = 0.5) = 0.9961

Two-sided test:
  H0: median of vote1 - vote2  = 0 vs.
  Ha: median of vote1 - vote2  != 0
      Pr(#positive >= 7 or #negative >= 7) =
         min(1, 2*Binomial(n = 8, x >= 7, p = 0.5)) = 0.0703
=== Exclude vs. Stay ===

Sign test

        Sign |    Observed    Expected
-------------+------------------------
    Positive |           6         3.5
    Negative |           1         3.5
        Zero |           1           1
-------------+------------------------
         All |           8           8

One-sided tests:
  H0: median of vote2 - vote3  = 0 vs.
  Ha: median of vote2 - vote3  > 0
      Pr(#positive >= 6) =
         Binomial(n = 7, x >= 6, p = 0.5) = 0.0625

  H0: median of vote2 - vote3  = 0 vs.
  Ha: median of vote2 - vote3  < 0
      Pr(#negative >= 1) =
         Binomial(n = 7, x >= 1, p = 0.5) = 0.9922

Two-sided test:
  H0: median of vote2 - vote3  = 0 vs.
  Ha: median of vote2 - vote3  != 0
      Pr(#positive >= 6 or #negative >= 6) =
         min(1, 2*Binomial(n = 7, x >= 6, p = 0.5)) = 0.1250
=== Leave vs. Stay ===

Sign test

        Sign |    Observed    Expected
-------------+------------------------
    Positive |           7           4
    Negative |           1           4
        Zero |           0           0
-------------+------------------------
         All |           8           8

One-sided tests:
  H0: median of vote1 - vote3  = 0 vs.
  Ha: median of vote1 - vote3  > 0
      Pr(#positive >= 7) =
         Binomial(n = 8, x >= 7, p = 0.5) = 0.0352

  H0: median of vote1 - vote3  = 0 vs.
  Ha: median of vote1 - vote3  < 0
      Pr(#negative >= 1) =
         Binomial(n = 8, x >= 1, p = 0.5) = 0.9961

Two-sided test:
  H0: median of vote1 - vote3  = 0 vs.
  Ha: median of vote1 - vote3  != 0
      Pr(#positive >= 7 or #negative >= 7) =
         min(1, 2*Binomial(n = 8, x >= 7, p = 0.5)) = 0.0703
===Treat = 2 ===
=== Leave vs. Exclude ===

Sign test

        Sign |    Observed    Expected
-------------+------------------------
    Positive |           7           4
    Negative |           1           4
        Zero |           0           0
-------------+------------------------
         All |           8           8

One-sided tests:
  H0: median of vote1 - vote2  = 0 vs.
  Ha: median of vote1 - vote2  > 0
      Pr(#positive >= 7) =
         Binomial(n = 8, x >= 7, p = 0.5) = 0.0352

  H0: median of vote1 - vote2  = 0 vs.
  Ha: median of vote1 - vote2  < 0
      Pr(#negative >= 1) =
         Binomial(n = 8, x >= 1, p = 0.5) = 0.9961

Two-sided test:
  H0: median of vote1 - vote2  = 0 vs.
  Ha: median of vote1 - vote2  != 0
      Pr(#positive >= 7 or #negative >= 7) =
         min(1, 2*Binomial(n = 8, x >= 7, p = 0.5)) = 0.0703
=== Exclude vs. Stay ===

Sign test

        Sign |    Observed    Expected
-------------+------------------------
    Positive |           4         3.5
    Negative |           3         3.5
        Zero |           1           1
-------------+------------------------
         All |           8           8

One-sided tests:
  H0: median of vote2 - vote3  = 0 vs.
  Ha: median of vote2 - vote3  > 0
      Pr(#positive >= 4) =
         Binomial(n = 7, x >= 4, p = 0.5) = 0.5000

  H0: median of vote2 - vote3  = 0 vs.
  Ha: median of vote2 - vote3  < 0
      Pr(#negative >= 3) =
         Binomial(n = 7, x >= 3, p = 0.5) = 0.7734

Two-sided test:
  H0: median of vote2 - vote3  = 0 vs.
  Ha: median of vote2 - vote3  != 0
      Pr(#positive >= 4 or #negative >= 4) =
         min(1, 2*Binomial(n = 7, x >= 4, p = 0.5)) = 1.0000
=== Leave vs. Stay ===

Sign test

        Sign |    Observed    Expected
-------------+------------------------
    Positive |           7         3.5
    Negative |           0         3.5
        Zero |           1           1
-------------+------------------------
         All |           8           8

One-sided tests:
  H0: median of vote1 - vote3  = 0 vs.
  Ha: median of vote1 - vote3  > 0
      Pr(#positive >= 7) =
         Binomial(n = 7, x >= 7, p = 0.5) = 0.0078

  H0: median of vote1 - vote3  = 0 vs.
  Ha: median of vote1 - vote3  < 0
      Pr(#negative >= 0) =
         Binomial(n = 7, x >= 0, p = 0.5) = 1.0000

Two-sided test:
  H0: median of vote1 - vote3  = 0 vs.
  Ha: median of vote1 - vote3  != 0
      Pr(#positive >= 7 or #negative >= 7) =
         min(1, 2*Binomial(n = 7, x >= 7, p = 0.5)) = 0.0156
===Treat = 3 ===
=== Leave vs. Exclude ===

Sign test

        Sign |    Observed    Expected
-------------+------------------------
    Positive |           3           3
    Negative |           3           3
        Zero |           2           2
-------------+------------------------
         All |           8           8

One-sided tests:
  H0: median of vote1 - vote2  = 0 vs.
  Ha: median of vote1 - vote2  > 0
      Pr(#positive >= 3) =
         Binomial(n = 6, x >= 3, p = 0.5) = 0.6563

  H0: median of vote1 - vote2  = 0 vs.
  Ha: median of vote1 - vote2  < 0
      Pr(#negative >= 3) =
         Binomial(n = 6, x >= 3, p = 0.5) = 0.6563

Two-sided test:
  H0: median of vote1 - vote2  = 0 vs.
  Ha: median of vote1 - vote2  != 0
      Pr(#positive >= 3 or #negative >= 3) =
         min(1, 2*Binomial(n = 6, x >= 3, p = 0.5)) = 1.0000
=== Exclude vs. Stay ===

Sign test

        Sign |    Observed    Expected
-------------+------------------------
    Positive |           6           3
    Negative |           0           3
        Zero |           2           2
-------------+------------------------
         All |           8           8

One-sided tests:
  H0: median of vote2 - vote3  = 0 vs.
  Ha: median of vote2 - vote3  > 0
      Pr(#positive >= 6) =
         Binomial(n = 6, x >= 6, p = 0.5) = 0.0156

  H0: median of vote2 - vote3  = 0 vs.
  Ha: median of vote2 - vote3  < 0
      Pr(#negative >= 0) =
         Binomial(n = 6, x >= 0, p = 0.5) = 1.0000

Two-sided test:
  H0: median of vote2 - vote3  = 0 vs.
  Ha: median of vote2 - vote3  != 0
      Pr(#positive >= 6 or #negative >= 6) =
         min(1, 2*Binomial(n = 6, x >= 6, p = 0.5)) = 0.0313
=== Leave vs. Stay ===

Sign test

        Sign |    Observed    Expected
-------------+------------------------
    Positive |           8           4
    Negative |           0           4
        Zero |           0           0
-------------+------------------------
         All |           8           8

One-sided tests:
  H0: median of vote1 - vote3  = 0 vs.
  Ha: median of vote1 - vote3  > 0
      Pr(#positive >= 8) =
         Binomial(n = 8, x >= 8, p = 0.5) = 0.0039

  H0: median of vote1 - vote3  = 0 vs.
  Ha: median of vote1 - vote3  < 0
      Pr(#negative >= 0) =
         Binomial(n = 8, x >= 0, p = 0.5) = 1.0000

Two-sided test:
  H0: median of vote1 - vote3  = 0 vs.
  Ha: median of vote1 - vote3  != 0
      Pr(#positive >= 8 or #negative >= 8) =
         min(1, 2*Binomial(n = 8, x >= 8, p = 0.5)) = 0.0078
===Treat = 4 ===
=== Leave vs. Exclude ===

Sign test

        Sign |    Observed    Expected
-------------+------------------------
    Positive |           2           4
    Negative |           6           4
        Zero |           0           0
-------------+------------------------
         All |           8           8

One-sided tests:
  H0: median of vote1 - vote2  = 0 vs.
  Ha: median of vote1 - vote2  > 0
      Pr(#positive >= 2) =
         Binomial(n = 8, x >= 2, p = 0.5) = 0.9648

  H0: median of vote1 - vote2  = 0 vs.
  Ha: median of vote1 - vote2  < 0
      Pr(#negative >= 6) =
         Binomial(n = 8, x >= 6, p = 0.5) = 0.1445

Two-sided test:
  H0: median of vote1 - vote2  = 0 vs.
  Ha: median of vote1 - vote2  != 0
      Pr(#positive >= 6 or #negative >= 6) =
         min(1, 2*Binomial(n = 8, x >= 6, p = 0.5)) = 0.2891
=== Exclude vs. Stay ===

Sign test

        Sign |    Observed    Expected
-------------+------------------------
    Positive |           6           4
    Negative |           2           4
        Zero |           0           0
-------------+------------------------
         All |           8           8

One-sided tests:
  H0: median of vote2 - vote3  = 0 vs.
  Ha: median of vote2 - vote3  > 0
      Pr(#positive >= 6) =
         Binomial(n = 8, x >= 6, p = 0.5) = 0.1445

  H0: median of vote2 - vote3  = 0 vs.
  Ha: median of vote2 - vote3  < 0
      Pr(#negative >= 2) =
         Binomial(n = 8, x >= 2, p = 0.5) = 0.9648

Two-sided test:
  H0: median of vote2 - vote3  = 0 vs.
  Ha: median of vote2 - vote3  != 0
      Pr(#positive >= 6 or #negative >= 6) =
         min(1, 2*Binomial(n = 8, x >= 6, p = 0.5)) = 0.2891
=== Leave vs. Stay ===

Sign test

        Sign |    Observed    Expected
-------------+------------------------
    Positive |           4           4
    Negative |           4           4
        Zero |           0           0
-------------+------------------------
         All |           8           8

One-sided tests:
  H0: median of vote1 - vote3  = 0 vs.
  Ha: median of vote1 - vote3  > 0
      Pr(#positive >= 4) =
         Binomial(n = 8, x >= 4, p = 0.5) = 0.6367

  H0: median of vote1 - vote3  = 0 vs.
  Ha: median of vote1 - vote3  < 0
      Pr(#negative >= 4) =
         Binomial(n = 8, x >= 4, p = 0.5) = 0.6367

Two-sided test:
  H0: median of vote1 - vote3  = 0 vs.
  Ha: median of vote1 - vote3  != 0
      Pr(#positive >= 4 or #negative >= 4) =
         min(1, 2*Binomial(n = 8, x >= 4, p = 0.5)) = 1.0000
===Treat = 5 ===
=== Leave vs. Exclude ===

Sign test

        Sign |    Observed    Expected
-------------+------------------------
    Positive |           0           2
    Negative |           4           2
        Zero |           0           0
-------------+------------------------
         All |           4           4

One-sided tests:
  H0: median of vote1 - vote2  = 0 vs.
  Ha: median of vote1 - vote2  > 0
      Pr(#positive >= 0) =
         Binomial(n = 4, x >= 0, p = 0.5) = 1.0000

  H0: median of vote1 - vote2  = 0 vs.
  Ha: median of vote1 - vote2  < 0
      Pr(#negative >= 4) =
         Binomial(n = 4, x >= 4, p = 0.5) = 0.0625

Two-sided test:
  H0: median of vote1 - vote2  = 0 vs.
  Ha: median of vote1 - vote2  != 0
      Pr(#positive >= 4 or #negative >= 4) =
         min(1, 2*Binomial(n = 4, x >= 4, p = 0.5)) = 0.1250
=== Exclude vs. Stay ===

Sign test

        Sign |    Observed    Expected
-------------+------------------------
    Positive |           1         1.5
    Negative |           2         1.5
        Zero |           1           1
-------------+------------------------
         All |           4           4

One-sided tests:
  H0: median of vote2 - vote3  = 0 vs.
  Ha: median of vote2 - vote3  > 0
      Pr(#positive >= 1) =
         Binomial(n = 3, x >= 1, p = 0.5) = 0.8750

  H0: median of vote2 - vote3  = 0 vs.
  Ha: median of vote2 - vote3  < 0
      Pr(#negative >= 2) =
         Binomial(n = 3, x >= 2, p = 0.5) = 0.5000

Two-sided test:
  H0: median of vote2 - vote3  = 0 vs.
  Ha: median of vote2 - vote3  != 0
      Pr(#positive >= 2 or #negative >= 2) =
         min(1, 2*Binomial(n = 3, x >= 2, p = 0.5)) = 1.0000
=== Leave vs. Stay ===

Sign test

        Sign |    Observed    Expected
-------------+------------------------
    Positive |           0           2
    Negative |           4           2
        Zero |           0           0
-------------+------------------------
         All |           4           4

One-sided tests:
  H0: median of vote1 - vote3  = 0 vs.
  Ha: median of vote1 - vote3  > 0
      Pr(#positive >= 0) =
         Binomial(n = 4, x >= 0, p = 0.5) = 1.0000

  H0: median of vote1 - vote3  = 0 vs.
  Ha: median of vote1 - vote3  < 0
      Pr(#negative >= 4) =
         Binomial(n = 4, x >= 4, p = 0.5) = 0.0625

Two-sided test:
  H0: median of vote1 - vote3  = 0 vs.
  Ha: median of vote1 - vote3  != 0
      Pr(#positive >= 4 or #negative >= 4) =
         min(1, 2*Binomial(n = 4, x >= 4, p = 0.5)) = 0.1250

.         
. **      Is the difference (Vote 2- Vote3)=(Exclude - Stay) equal across treatments?
.         gen temp=vote2-vote3

. 
.         reshape long vote,   i(treatment sessionID)    j(group_preferences)
(j = 1 2 3)

Data                               Wide   ->   Long
-----------------------------------------------------------------------------
Number of observations               36   ->   108         
Number of variables                   6   ->   5           
j variable (3 values)                     ->   group_preferences
xij variables:
                      vote1 vote2 vote3   ->   vote
-----------------------------------------------------------------------------

.         table (group_) (treat) , statistic(mean  vote)  nformat(%9.2f) nototals

---------------------------------------------------------------------------
                  |                         Treatment                      
                  |  Neutral   Converge   Diverge   Neutral+   Neutral-Chat
------------------+--------------------------------------------------------
group_preferences |                                                        
  1               |     0.47       0.47      0.46       0.31           0.08
  2               |     0.33       0.29      0.38       0.38           0.41
  3               |     0.20       0.24      0.17       0.31           0.51
---------------------------------------------------------------------------

. 
.         replace temp=. if group_preferences!=3
(72 real changes made, 72 to missing)

.         ranksum temp if inlist(treat, 1,2), by(treat) exact

Two-sample Wilcoxon rank-sum (Mann–Whitney) test

   treatment |      Obs    Rank sum    Expected
-------------+---------------------------------
     Neutral |        8          79          68
    Converge |        8          57          68
-------------+---------------------------------
    Combined |       16         136         136

Unadjusted variance       90.67
Adjustment for ties       -0.27
                     ----------
Adjusted variance         90.40

H0: temp(treatm~t==Neutral) = temp(treatm~t==Converge)
         z =  1.157
Prob > |z| = 0.2473
Exact prob = 0.2667

.         ranksum temp if inlist(treat, 2,3), by(treat) exact

Two-sample Wilcoxon rank-sum (Mann–Whitney) test

   treatment |      Obs    Rank sum    Expected
-------------+---------------------------------
    Converge |        8          52          68
     Diverge |        8          84          68
-------------+---------------------------------
    Combined |       16         136         136

Unadjusted variance       90.67
Adjustment for ties       -0.93
                     ----------
Adjusted variance         89.73

H0: temp(treatm~t==Converge) = temp(treatm~t==Diverge)
         z = -1.689
Prob > |z| = 0.0912
Exact prob = 0.0959

.         ranksum temp if inlist(treat, 1,3), by(treat) exact

Two-sample Wilcoxon rank-sum (Mann–Whitney) test

   treatment |      Obs    Rank sum    Expected
-------------+---------------------------------
     Neutral |        8          59          68
     Diverge |        8          77          68
-------------+---------------------------------
    Combined |       16         136         136

Unadjusted variance       90.67
Adjustment for ties       -0.93
                     ----------
Adjusted variance         89.73

H0: temp(treatm~t==Neutral) = temp(treatm~t==Diverge)
         z = -0.950
Prob > |z| = 0.3421
Exact prob = 0.3667

.         ranksum temp if inlist(treat, 1,5), by(treat) exact

Two-sample Wilcoxon rank-sum (Mann–Whitney) test

   treatment |      Obs    Rank sum    Expected
-------------+---------------------------------
     Neutral |        8          61          52
Neutral-Chat |        4          17          26
-------------+---------------------------------
    Combined |       12          78          78

Unadjusted variance       34.67
Adjustment for ties       -0.24
                     ----------
Adjusted variance         34.42

H0: temp(treatm~t==Neutral) = temp(treatm~t==Neutral-Chat)
         z =  1.534
Prob > |z| = 0.1250
Exact prob = 0.1495

. 
. **   Is there a difference in voting choices ACROSS TREATMENTS ? 
.         local voting "1 2 3"

.         foreach i of local voting{
  2.         dis "==       Vote " `i'  "         =="
  3.          ranksumex vote if group_preferences==`i' & inlist(treat, 1,2), by(treat)       
  4.          ranksumex vote if group_preferences==`i' & inlist(treat, 1,3), by(treat) 
  5.          ranksumex vote if group_preferences==`i' & inlist(treat, 1,4), by(treat) 
  6.          ranksumex vote if group_preferences==`i' & inlist(treat, 2,3), by(treat) 
  7.          ranksumex vote if group_preferences==`i' & inlist(treat, 1,5), by(treat) 
  8.         }
==       Vote 1         ==

Two-sample Wilcoxon rank-sum (Mann-Whitney) test

   treatment |      obs    rank sum    expected
-------------+---------------------------------
     Neutral |        8          68          68
    Converge |        8          68          68
-------------+---------------------------------
    combined |       16         136         136

Exact statistics
Ho: vote(treatm~t==Neutral) = vote(treatm~t==Converge)
    Prob <=        68 = 0.5124
    Prob >=        68 = 0.5124
    Two-sided p-value = 1.0249

Two-sample Wilcoxon rank-sum (Mann-Whitney) test

   treatment |      obs    rank sum    expected
-------------+---------------------------------
     Neutral |        8        70.5          68
     Diverge |        8        65.5          68
-------------+---------------------------------
    combined |       16         136         136

Exact statistics
Ho: vote(treatm~t==Neutral) = vote(treatm~t==Diverge)
    Prob <=      65.5 = 0.4075
    Prob >=      70.5 = 0.4075
    Two-sided p-value = 0.8149

Two-sample Wilcoxon rank-sum (Mann-Whitney) test

   treatment |      obs    rank sum    expected
-------------+---------------------------------
     Neutral |        8          87          68
    Neutral+ |        8          49          68
-------------+---------------------------------
    combined |       16         136         136

Exact statistics
Ho: vote(treatm~t==Neutral) = vote(treatm~t==Neutral+)
    Prob <=        49 = 0.0236
    Prob >=        87 = 0.0236
    Two-sided p-value = 0.0472

Two-sample Wilcoxon rank-sum (Mann-Whitney) test

   treatment |      obs    rank sum    expected
-------------+---------------------------------
    Converge |        8          71          68
     Diverge |        8          65          68
-------------+---------------------------------
    combined |       16         136         136

Exact statistics
Ho: vote(treatm~t==Converge) = vote(treatm~t==Diverge)
    Prob <=        65 = 0.3873
    Prob >=        71 = 0.3873
    Two-sided p-value = 0.7745

Two-sample Wilcoxon rank-sum (Mann-Whitney) test

   treatment |      obs    rank sum    expected
-------------+---------------------------------
     Neutral |        8          68          52
Neutral-Chat |        4          10          26
-------------+---------------------------------
    combined |       12          78          78

Exact statistics
Ho: vote(treatm~t==Neutral) = vote(treatm~t==Neutral-Chat)
    Prob <=        10 = 0.0020
    Prob >=        42 = 0.0020
    Two-sided p-value = 0.0040
==       Vote 2         ==

Two-sample Wilcoxon rank-sum (Mann-Whitney) test

   treatment |      obs    rank sum    expected
-------------+---------------------------------
     Neutral |        8        77.5          68
    Converge |        8        58.5          68
-------------+---------------------------------
    combined |       16         136         136

Exact statistics
Ho: vote(treatm~t==Neutral) = vote(treatm~t==Converge)
    Prob <=      58.5 = 0.1626
    Prob >=      77.5 = 0.1626
    Two-sided p-value = 0.3253

Two-sample Wilcoxon rank-sum (Mann-Whitney) test

   treatment |      obs    rank sum    expected
-------------+---------------------------------
     Neutral |        8        59.5          68
     Diverge |        8        76.5          68
-------------+---------------------------------
    combined |       16         136         136

Exact statistics
Ho: vote(treatm~t==Neutral) = vote(treatm~t==Diverge)
    Prob <=      59.5 = 0.1977
    Prob >=      76.5 = 0.1977
    Two-sided p-value = 0.3955

Two-sample Wilcoxon rank-sum (Mann-Whitney) test

   treatment |      obs    rank sum    expected
-------------+---------------------------------
     Neutral |        8          60          68
    Neutral+ |        8          76          68
-------------+---------------------------------
    combined |       16         136         136

Exact statistics
Ho: vote(treatm~t==Neutral) = vote(treatm~t==Neutral+)
    Prob <=        60 = 0.2093
    Prob >=        76 = 0.2093
    Two-sided p-value = 0.4186

Two-sample Wilcoxon rank-sum (Mann-Whitney) test

   treatment |      obs    rank sum    expected
-------------+---------------------------------
    Converge |        8        54.5          68
     Diverge |        8        81.5          68
-------------+---------------------------------
    combined |       16         136         136

Exact statistics
Ho: vote(treatm~t==Converge) = vote(treatm~t==Diverge)
    Prob <=      54.5 = 0.0824
    Prob >=      81.5 = 0.0824
    Two-sided p-value = 0.1649

Two-sample Wilcoxon rank-sum (Mann-Whitney) test

   treatment |      obs    rank sum    expected
-------------+---------------------------------
     Neutral |        8        46.5          52
Neutral-Chat |        4        31.5          26
-------------+---------------------------------
    combined |       12          78          78

Exact statistics
Ho: vote(treatm~t==Neutral) = vote(treatm~t==Neutral-Chat)
    Prob <=      20.5 = 0.2000
    Prob >=      31.5 = 0.2000
    Two-sided p-value = 0.4000
==       Vote 3         ==

Two-sample Wilcoxon rank-sum (Mann-Whitney) test

   treatment |      obs    rank sum    expected
-------------+---------------------------------
     Neutral |        8          60          68
    Converge |        8          76          68
-------------+---------------------------------
    combined |       16         136         136

Exact statistics
Ho: vote(treatm~t==Neutral) = vote(treatm~t==Converge)
    Prob <=        60 = 0.2148
    Prob >=        76 = 0.2148
    Two-sided p-value = 0.4295

Two-sample Wilcoxon rank-sum (Mann-Whitney) test

   treatment |      obs    rank sum    expected
-------------+---------------------------------
     Neutral |        8          74          68
     Diverge |        8          62          68
-------------+---------------------------------
    combined |       16         136         136

Exact statistics
Ho: vote(treatm~t==Neutral) = vote(treatm~t==Diverge)
    Prob <=        62 = 0.2716
    Prob >=        74 = 0.2716
    Two-sided p-value = 0.5433

Two-sample Wilcoxon rank-sum (Mann-Whitney) test

   treatment |      obs    rank sum    expected
-------------+---------------------------------
     Neutral |        8        54.5          68
    Neutral+ |        8        81.5          68
-------------+---------------------------------
    combined |       16         136         136

Exact statistics
Ho: vote(treatm~t==Neutral) = vote(treatm~t==Neutral+)
    Prob <=      54.5 = 0.0824
    Prob >=      81.5 = 0.0824
    Two-sided p-value = 0.1647

Two-sample Wilcoxon rank-sum (Mann-Whitney) test

   treatment |      obs    rank sum    expected
-------------+---------------------------------
    Converge |        8        83.5          68
     Diverge |        8        52.5          68
-------------+---------------------------------
    combined |       16         136         136

Exact statistics
Ho: vote(treatm~t==Converge) = vote(treatm~t==Diverge)
    Prob <=      52.5 = 0.0534
    Prob >=      83.5 = 0.0534
    Two-sided p-value = 0.1068

Two-sample Wilcoxon rank-sum (Mann-Whitney) test

   treatment |      obs    rank sum    expected
-------------+---------------------------------
     Neutral |        8          36          52
Neutral-Chat |        4          42          26
-------------+---------------------------------
    combined |       12          78          78

Exact statistics
Ho: vote(treatm~t==Neutral) = vote(treatm~t==Neutral-Chat)
    Prob <=        10 = 0.0000
    Prob >=        42 = 0.0020
    Two-sided p-value = 0.0020

. restore

. 
. 
. *========================================================================
. *       MUTINOMIAL LOGIT (individual level) -  TREATMENT EFFECT ON GROUP CHOICES  (TABLE 4)
. *========================================================================
. use $data 

. preserve

.         keep if treat<5
(10,008 observations deleted)

.         drop if game==5
(16,512 observations deleted)

.         macro define controls "sex response_t wrong_ans"                

. 
.         collapse  choice otherchoice profit fullc outcome  vote* $controls , by (treatment sessionID game country groupsize ID order)

. 
. **      Realized profit of average supergame (Fixed Pairs and Mixed Groups)
.         gen profitP=profit if groupsize==2
(1,536 missing values generated)

.         gen profitMG=profit if groupsize==12
(1,536 missing values generated)

. 
.  **     COLLAPSE at SESSION level by ID:     [voteNEW=1,2,3=leave,exclude,stay ]
.         collapse  fullc profitP profitMG  vote1 vote2 vote3 voteNEW  $controls, by (treatment sessionID  country ID order)

. 
.         table (country) (treat) , statistic(mean  vote1)  nformat(%9.2f) nototals

----------------------------------------------------
          |                 Treatment               
          |  Neutral   Converge   Diverge   Neutral+
----------+-----------------------------------------
Country   |                                         
  Disadv. |     0.42       0.27      0.47       0.27
  Middle  |     0.44       0.48      0.38       0.36
  Advan.  |     0.55       0.66      0.53       0.31
----------------------------------------------------

.         table (country) (treat) , statistic(mean  vote2)  nformat(%9.2f) nototals

----------------------------------------------------
          |                 Treatment               
          |  Neutral   Converge   Diverge   Neutral+
----------+-----------------------------------------
Country   |                                         
  Disadv. |     0.28       0.45      0.36       0.38
  Middle  |     0.41       0.23      0.48       0.39
  Advan.  |     0.31       0.17      0.28       0.36
----------------------------------------------------

.         table (country) (treat) , statistic(mean  vote3)  nformat(%9.2f) nototals

----------------------------------------------------
          |                 Treatment               
          |  Neutral   Converge   Diverge   Neutral+
----------+-----------------------------------------
Country   |                                         
  Disadv. |     0.30       0.28      0.17       0.36
  Middle  |     0.16       0.28      0.14       0.25
  Advan.  |     0.14       0.17      0.19       0.33
----------------------------------------------------

.         
. 
. **      MULTINOMIAL LOGIT 
.         est clear 

.         gen Gains=profitMG - profitP

.         macro define controls "response_t   wrong_ans  i.sex"    

.         center  response_t wrong_ans  Gains, inplace  standardize 
(modified variables: response_t wrong_ans Gains)

.         
.         mlogit voteNEW    ib1.treat##c.Gains   i.order  $controls, cluster(session)

Iteration 0:   log pseudolikelihood = -820.66704  
Iteration 1:   log pseudolikelihood = -740.96243  
Iteration 2:   log pseudolikelihood =  -738.3794  
Iteration 3:   log pseudolikelihood = -738.37248  
Iteration 4:   log pseudolikelihood = -738.37248  

Multinomial logistic regression                         Number of obs =    768
                                                        Wald chi2(22) = 337.84
                                                        Prob > chi2   = 0.0000
Log pseudolikelihood = -738.37248                       Pseudo R2     = 0.1003

                                  (Std. err. adjusted for 32 clusters in sessionID)
-----------------------------------------------------------------------------------
                  |               Robust
          voteNEW | Coefficient  std. err.      z    P>|z|     [95% conf. interval]
------------------+----------------------------------------------------------------
1                 |  (base outcome)
------------------+----------------------------------------------------------------
2                 |
        treatment |
        Converge  |   .0043481   .2544265     0.02   0.986    -.4943187     .503015
         Diverge  |   .0821223   .2409741     0.34   0.733    -.3901784     .554423
        Neutral+  |    .290242   .2218783     1.31   0.191    -.1446314    .7251154
                  |
            Gains |   .5921731   .2174647     2.72   0.006     .1659501    1.018396
                  |
treatment#c.Gains |
        Converge  |   .6391644   .3069201     2.08   0.037      .037612    1.240717
         Diverge  |   .1197834   .2546531     0.47   0.638    -.3793274    .6188943
        Neutral+  |    .095107   .2482618     0.38   0.702    -.3914772    .5816913
                  |
            order |
     large first  |   .3126211   .1699448     1.84   0.066    -.0204647    .6457068
       response_t |  -.0355522   .0798432    -0.45   0.656    -.1920419    .1209375
        wrong_ans |   .1511292   .0736135     2.05   0.040     .0068494    .2954091
            1.sex |   .1385006   .1767363     0.78   0.433    -.2078962    .4848974
            _cons |  -.4226916   .2442977    -1.73   0.084    -.9015062    .0561231
------------------+----------------------------------------------------------------
3                 |
        treatment |
        Converge  |   .3259092   .3993174     0.82   0.414    -.4567384    1.108557
         Diverge  |  -.2142005   .3187216    -0.67   0.502    -.8388833    .4104824
        Neutral+  |   .5341891    .362611     1.47   0.141    -.1765154    1.244894
                  |
            Gains |   1.087634   .2899704     3.75   0.000     .5193022    1.655965
                  |
treatment#c.Gains |
        Converge  |   .4468785   .3905957     1.14   0.253     -.318675    1.212432
         Diverge  |  -.1999703   .3494544    -0.57   0.567    -.8848883    .4849478
        Neutral+  |  -.1051118   .3130202    -0.34   0.737    -.7186201    .5083965
                  |
            order |
     large first  |   .8827231   .2426739     3.64   0.000      .407091    1.358355
       response_t |   .0087959   .1036553     0.08   0.932    -.1943648    .2119566
        wrong_ans |   .0363173   .0844145     0.43   0.667    -.1291322    .2017667
            1.sex |   -.394675   .2367118    -1.67   0.095    -.8586216    .0692716
            _cons |  -1.083859   .3441538    -3.15   0.002    -1.758388   -.4093304
-----------------------------------------------------------------------------------

.         eststo reg1

.  
. ** Marginal effects by choice
.         local i "1 2 3"

.         foreach i in 1 2 3 {
  2.         quietly margins, dydx(*) at((means) _all (base) _factor) predict(outcome(`i')) post
  3.         eststo Choice`i'
  4.         estimates restore reg1
  5.         }
(results reg1 are active now)
(results reg1 are active now)
(results reg1 are active now)

. 
.         estout Choice1 Choice2 Choice3 using output10.tex, replace cells(b(star fmt(3)) se(par fmt(3))) style(tex)  stats(N, labels("N")  fmt(0 3)) prefoot(\hline
> ) starlevels(* 0.10 ** 0.05 *** 0.01) posthead(\hline) varlabels(2.treatment "\ \ Converge" 3.treatment "\ \ Diverge" 4.treatment "\ \ Neutral+" 1.fullc "Full Coo
> peration=1" 2.fullc "Full Cooperation=2"  1.order "Order (12-12-2-2)" Gains "Realized Gain"    game Supergame  wrong_ans "Incorrect Answers" _cons Constant male M
> ale response_t "Response Time" 1.sex "Male" ) 
(file output10.tex not found)
(output written to output10.tex)

. 
.         eststo drop Choice1 Choice2 Choice3
(Choice1 dropped)
(Choice2 dropped)
(Choice3 dropped)

. 
.         estimates restore reg1
(results reg1 are active now)

.         margins, dydx(*) at((means) _all (base) _factor) post

Conditional marginal effects                               Number of obs = 768
Model VCE: Robust

dy/dx wrt: 2.treatment 3.treatment 4.treatment Gains 1.order response_t wrong_ans 1.sex

1._predict: Pr(voteNEW==1), predict(pr outcome(1))
2._predict: Pr(voteNEW==2), predict(pr outcome(2))
3._predict: Pr(voteNEW==3), predict(pr outcome(3))

At: treatment  =         1
    Gains      =  1.08e-09 (mean)
    order      =         0
    response_t = -3.31e-08 (mean)
    wrong_ans  = -3.91e-08 (mean)
    sex        =         0

------------------------------------------------------------------------------
             |            Delta-method
             |      dy/dx   std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
1.treatment  |  (base outcome)
-------------+----------------------------------------------------------------
2.treatment  |
    _predict |
          1  |  -.0314148   .0703025    -0.45   0.655    -.1692053    .1063756
          2  |  -.0192429    .044298    -0.43   0.664    -.1060653    .0675795
          3  |   .0506578   .0537692     0.94   0.346    -.0547279    .1560434
-------------+----------------------------------------------------------------
3.treatment  |
    _predict |
          1  |   .0023108   .0594943     0.04   0.969    -.1142958    .1189175
          2  |   .0297766   .0468395     0.64   0.525    -.0620272    .1215803
          3  |  -.0320874   .0381068    -0.84   0.400    -.1067753    .0426005
-------------+----------------------------------------------------------------
4.treatment  |
    _predict |
          1  |  -.0939636   .0619913    -1.52   0.130    -.2154642    .0275371
          2  |   .0283821   .0387629     0.73   0.464    -.0475919     .104356
          3  |   .0655815   .0483871     1.36   0.175    -.0292555    .1604185
-------------+----------------------------------------------------------------
Gains        |
    _predict |
          1  |  -.1902146   .0444903    -4.28   0.000     -.277414   -.1030152
          2  |   .0700018   .0530764     1.32   0.187     -.034026    .1740297
          3  |   .1202127   .0435263     2.76   0.006     .0349027    .2055228
-------------+----------------------------------------------------------------
0.order      |  (base outcome)
-------------+----------------------------------------------------------------
1.order      |
    _predict |
          1  |  -.1330952   .0419669    -3.17   0.002    -.2153489   -.0508415
          2  |   .0014103   .0363004     0.04   0.969    -.0697371    .0725577
          3  |   .1316849   .0359333     3.66   0.000     .0612569    .2021129
-------------+----------------------------------------------------------------
response_t   |
    _predict |
          1  |   .0051131   .0179808     0.28   0.776    -.0301285    .0403548
          2  |  -.0083354   .0167722    -0.50   0.619    -.0412082    .0245375
          3  |   .0032223   .0137864     0.23   0.815    -.0237985    .0302431
-------------+----------------------------------------------------------------
wrong_ans    |
    _predict |
          1  |  -.0280093   .0154243    -1.82   0.069    -.0582403    .0022217
          2  |   .0313218   .0147806     2.12   0.034     .0023523    .0602914
          3  |  -.0033125   .0109879    -0.30   0.763    -.0248485    .0182234
-------------+----------------------------------------------------------------
0.sex        |  (base outcome)
-------------+----------------------------------------------------------------
1.sex        |
    _predict |
          1  |   .0032858   .0400634     0.08   0.935     -.075237    .0818085
          2  |   .0513011   .0367287     1.40   0.162    -.0206859     .123288
          3  |  -.0545868   .0236231    -2.31   0.021    -.1008873   -.0082863
------------------------------------------------------------------------------
Note: dy/dx for factor levels is the discrete change from the base level.

.                 
. ** ARE THERE DIFFERENT VOTING OUTCOMES ACROSS TREATMENTS?
.         local vote "1 2 3"

.         foreach i of local vote {
  2.         dis "*******       Vote =" `i'  "     ******* "
  3.         test [2.treatment]`i'._predict =[3.treatment]`i'._predict 
  4.         test [2.treatment]`i'._predict =[4.treatment]`i'._predict 
  5.         test [3.treatment]`i'._predict =[4.treatment]`i'._predict 
  6.         }
*******       Vote =1     ******* 

 ( 1)  [2.treatment]1bn._predict - [3.treatment]1bn._predict = 0

           chi2(  1) =    0.35
         Prob > chi2 =    0.5538

 ( 1)  [2.treatment]1bn._predict - [4.treatment]1bn._predict = 0

           chi2(  1) =    1.10
         Prob > chi2 =    0.2943

 ( 1)  [3.treatment]1bn._predict - [4.treatment]1bn._predict = 0

           chi2(  1) =    4.01
         Prob > chi2 =    0.0452
*******       Vote =2     ******* 

 ( 1)  [2.treatment]2._predict - [3.treatment]2._predict = 0

           chi2(  1) =    1.12
         Prob > chi2 =    0.2909

 ( 1)  [2.treatment]2._predict - [4.treatment]2._predict = 0

           chi2(  1) =    1.45
         Prob > chi2 =    0.2290

 ( 1)  [3.treatment]2._predict - [4.treatment]2._predict = 0

           chi2(  1) =    0.00
         Prob > chi2 =    0.9728
*******       Vote =3     ******* 

 ( 1)  [2.treatment]3._predict - [3.treatment]3._predict = 0

           chi2(  1) =    3.62
         Prob > chi2 =    0.0570

 ( 1)  [2.treatment]3._predict - [4.treatment]3._predict = 0

           chi2(  1) =    0.08
         Prob > chi2 =    0.7739

 ( 1)  [3.treatment]3._predict - [4.treatment]3._predict = 0

           chi2(  1) =    7.31
         Prob > chi2 =    0.0068

.         
.         test [c.Gains]2._predict =[c.Gains]3._predict 

 ( 1)  [Gains]2._predict - [Gains]3._predict = 0

           chi2(  1) =    0.34
         Prob > chi2 =    0.5606

. 
. restore

. 
. ** == CHAT VS. NEUTRAL ==**
. use $data 

. preserve

.         keep if inlist(treat,1,5)
(60,624 observations deleted)

.         keep if order==0
(9,648 observations deleted)

.         drop if game==5
(3,864 observations deleted)

.         macro define controls "sex response_t wrong_ans"                

. 
.         collapse  choice otherchoice profit fullc outcome  vote* $controls , by (treatment sessionID game country groupsize ID)

. 
.         gen profitP=profit if groupsize==2
(384 missing values generated)

.         gen profitMG=profit if groupsize==12
(384 missing values generated)

. 
.  **     COLLAPSE at SESSION level by ID:     [voteNEW=1,2,3=leave,exclude,stay ]
.         collapse  fullc profitP profitMG  vote1 vote2 vote3 voteNEW  $controls, by (treatment sessionID  country ID)

. 
.         table (country) (treat) , statistic(mean  vote1)  nformat(%9.2f) nototals

-----------------------------------
          |         Treatment      
          |  Neutral   Neutral-Chat
----------+------------------------
Country   |                        
  Disadv. |     0.53           0.16
  Middle  |     0.41           0.00
  Advan.  |     0.50           0.09
-----------------------------------

.         table (country) (treat) , statistic(mean  vote2)  nformat(%9.2f) nototals

-----------------------------------
          |         Treatment      
          |  Neutral   Neutral-Chat
----------+------------------------
Country   |                        
  Disadv. |     0.34           0.28
  Middle  |     0.41           0.53
  Advan.  |     0.34           0.41
-----------------------------------

.         table (country) (treat) , statistic(mean  vote3)  nformat(%9.2f) nototals

-----------------------------------
          |         Treatment      
          |  Neutral   Neutral-Chat
----------+------------------------
Country   |                        
  Disadv. |     0.13           0.56
  Middle  |     0.19           0.47
  Advan.  |     0.16           0.50
-----------------------------------

. 
. **      MULTINOMIAL LOGIT 
.         est clear 

.         gen Gains=profitMG - profitP

.         macro define controls "response_t   wrong_ans  i.sex"    

.         center  response_t wrong_ans  Gains, inplace  standardize 
(modified variables: response_t wrong_ans Gains)

.         
.         mlogit voteNEW    ib1.treat##c.Gains   $controls, cluster(session)

Iteration 0:   log pseudolikelihood = -209.36464  
Iteration 1:   log pseudolikelihood = -170.79965  
Iteration 2:   log pseudolikelihood = -168.01825  
Iteration 3:   log pseudolikelihood = -167.92915  
Iteration 4:   log pseudolikelihood =  -167.9288  
Iteration 5:   log pseudolikelihood =  -167.9288  

Multinomial logistic regression                         Number of obs =    192
                                                        Wald chi2(5)  =      .
                                                        Prob > chi2   =      .
Log pseudolikelihood = -167.9288                        Pseudo R2     = 0.1979

                                   (Std. err. adjusted for 8 clusters in sessionID)
-----------------------------------------------------------------------------------
                  |               Robust
          voteNEW | Coefficient  std. err.      z    P>|z|     [95% conf. interval]
------------------+----------------------------------------------------------------
1                 |
        treatment |
    Neutral-Chat  |  -1.453742   .5243074    -2.77   0.006    -2.481366   -.4261186
            Gains |  -.8425605   .2227377    -3.78   0.000    -1.279118   -.4060027
                  |
treatment#c.Gains |
    Neutral-Chat  |   .2443957   .6918116     0.35   0.724     -1.11153    1.600322
                  |
       response_t |  -.1344651   .1373522    -0.98   0.328    -.4036705    .1347402
        wrong_ans |  -.1160546    .100734    -1.15   0.249    -.3134897    .0813805
            1.sex |  -.8470819   .3931327    -2.15   0.031    -1.617608    -.076556
            _cons |   .2226955   .2628654     0.85   0.397    -.2925112    .7379022
------------------+----------------------------------------------------------------
2                 |  (base outcome)
------------------+----------------------------------------------------------------
3                 |
        treatment |
    Neutral-Chat  |   .7229568   .4753992     1.52   0.128    -.2088086    1.654722
            Gains |   .3077751   .1816547     1.69   0.090    -.0482615    .6638118
                  |
treatment#c.Gains |
    Neutral-Chat  |   .2362204   .4184097     0.56   0.572    -.5838475    1.056288
                  |
       response_t |   .5049621   .1951774     2.59   0.010     .1224215    .8875027
        wrong_ans |   .0716143   .2269197     0.32   0.752    -.3731401    .5163687
            1.sex |  -.4870419   .4217259    -1.15   0.248    -1.313609    .3395257
            _cons |  -.6333825   .3321843    -1.91   0.057    -1.284452    .0176867
-----------------------------------------------------------------------------------

.         eststo reg1

.  
. ** Marginal effects by choice
.         local i "1 2 3"

.         foreach i in 1 2 3 {
  2.         quietly margins, dydx(*) at((means) _all (base) _factor) predict(outcome(`i')) post
  3.         eststo Choice`i'
  4.         estimates restore reg1
  5.         }
(results reg1 are active now)
(results reg1 are active now)
(results reg1 are active now)

. 
.         estout Choice1 Choice2 Choice3 using output11.tex, replace cells(b(star fmt(3)) se(par fmt(3))) style(tex)  stats(N, labels("N")  fmt(0 3)) prefoot(\hline
> ) starlevels(* 0.10 ** 0.05 *** 0.01) posthead(\hline) varlabels(5.treatment "Neutral-Chat"   Gains "Realized Gain"    game Supergame  wrong_ans "Incorrect Answer
> s" _cons Constant male Male response_t "Response Time" 1.sex "Male" ) 
(file output11.tex not found)
(output written to output11.tex)

. 
.         eststo drop Choice1 Choice2 Choice3
(Choice1 dropped)
(Choice2 dropped)
(Choice3 dropped)

. 
. restore

. 
. 
. 
. *============================================================================================================
. *       MUTINOMIAL LOGIT (individual level)-  GROUP CHOICES (ALL treatments pooled)
. *============================================================================================================
. use $data 

. preserve

.         graph drop _all

.         drop if game==5
(18,384 observations deleted)

.         keep if treat<5
(8,136 observations deleted)

.         macro define controls "sex response_t wrong_ans"                

. 
.  *** COLLAPSE by ID in SUPERGAME
.         collapse  choice otherchoice profit outcome vote* $controls , by (treatment sessionID game groupsize ID order)

. 
.         gen profitP=profit if groupsize ==2
(1,536 missing values generated)

.         gen profitMG=profit if groupsize ==12
(1,536 missing values generated)

. 
. *       Cooperation choices and relative to opponents
.         gen choiceP=choice if groupsize ==2
(1,536 missing values generated)

.         gen choiceMG=choice if groupsize ==12
(1,536 missing values generated)

.         gen otherchoiceP=otherchoice if groupsize ==2
(1,536 missing values generated)

.         gen otherchoiceMG=otherchoice if groupsize ==12
(1,536 missing values generated)

.         gen RelCoop_P=choiceP-otherchoiceP
(1,536 missing values generated)

.         gen RelCoop_MG=choiceMG-otherchoiceMG
(1,536 missing values generated)

. 
. *       COLLAPSE by ID/ SESSION:     [voteNEW=1,2,3=leave,exclude,stay ]
.         collapse  profitP profitMG  RelCoop_P RelCoop_MG vote1 vote2 vote3 voteNEW  $controls, by (treatment sessionID  ID order)

.         gen Gains=profitMG - profitP

.         center  response_t wrong_ans  Gains, inplace  standardize 
(modified variables: response_t wrong_ans Gains)

. 
. *       Create categories of cooperation 1=Free-rider   2=Conditional Cooperator 3= Altruist
.         egen RC_FP = cut(RelCoop_P), at(-1, -0.33, 0.33,1.1) icodes

.         egen RC_MG = cut(RelCoop_MG), at(-1, -0.33, 0.33,1.1)  icodes

.         replace RC_FP=RC_FP+1
(768 real changes made)

.         replace RC_MG=RC_MG+1   
(768 real changes made)

.         tabstat RelCoop_P, by(RC_FP) stats(min max)

Summary for variables: RelCoop_P
Group variable: RC_FP 

   RC_FP |       Min       Max
---------+--------------------
       1 | -.5888889 -.3333333
       2 | -.3111111  .3131313
       3 |  .3333333  .8888889
---------+--------------------
   Total | -.5888889  .8888889
------------------------------

.         tabstat RelCoop_MG, by(RC_MG) stats(min max)

Summary for variables: RelCoop_MG
Group variable: RC_MG 

   RC_MG |       Min       Max
---------+--------------------
       1 | -.8444445 -.3333333
       2 | -.3286325  .3282828
       3 |  .3313131  .8290598
---------+--------------------
   Total | -.8444445  .8290598
------------------------------

.         
. **      MULTINOMIAL LOGIT
.         macro define controls "response_t  wrong_ans   i.sex"    

.         est clear 

.         mlogit voteNEW    ib1.treat  ib2.RC_MG  ib2.RC_FP i.order  $controls, cluster(session)

Iteration 0:   log pseudolikelihood = -820.66704  
Iteration 1:   log pseudolikelihood = -786.21811  
Iteration 2:   log pseudolikelihood = -785.56972  
Iteration 3:   log pseudolikelihood = -785.56907  
Iteration 4:   log pseudolikelihood = -785.56907  

Multinomial logistic regression                         Number of obs =    768
                                                        Wald chi2(22) = 233.66
                                                        Prob > chi2   = 0.0000
Log pseudolikelihood = -785.56907                       Pseudo R2     = 0.0428

                             (Std. err. adjusted for 32 clusters in sessionID)
------------------------------------------------------------------------------
             |               Robust
     voteNEW | Coefficient  std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
1            |  (base outcome)
-------------+----------------------------------------------------------------
2            |
   treatment |
   Converge  |  -.1514659   .2469335    -0.61   0.540    -.6354467    .3325149
    Diverge  |   .1443423   .2828419     0.51   0.610    -.4100176    .6987023
   Neutral+  |   .4529263   .2527509     1.79   0.073    -.0424564     .948309
             |
       RC_MG |
          1  |   1.066306   .3283426     3.25   0.001     .4227662    1.709846
          3  |  -.0555206   .2641533    -0.21   0.834    -.5732516    .4622104
             |
       RC_FP |
          1  |   .1820032   .6557668     0.28   0.781    -1.103276    1.467283
          3  |   .3463879   .5452569     0.64   0.525     -.722296    1.415072
             |
       order |
large first  |   .0502044   .1789385     0.28   0.779    -.3005086    .4009174
  response_t |  -.0353935   .0785412    -0.45   0.652    -.1893316    .1185445
   wrong_ans |   .1777808   .0698274     2.55   0.011     .0409215      .31464
       1.sex |   .1046036   .1579629     0.66   0.508    -.2049981    .4142052
       _cons |  -.5036189   .2693203    -1.87   0.061    -1.031477    .0242392
-------------+----------------------------------------------------------------
3            |
   treatment |
   Converge  |   .1549519   .3944093     0.39   0.694    -.6180761    .9279799
    Diverge  |  -.1937825   .3349777    -0.58   0.563    -.8503268    .4627618
   Neutral+  |   .7563374   .3851878     1.96   0.050     .0013831    1.511292
             |
       RC_MG |
          1  |   1.312522   .2361762     5.56   0.000     .8496251    1.775419
          3  |  -.5767833   .3079236    -1.87   0.061    -1.180303    .0267359
             |
       RC_FP |
          1  |   .8876334   .9084123     0.98   0.329     -.892822    2.668089
          3  |   .1426693   1.062699     0.13   0.893    -1.940182     2.22552
             |
       order |
large first  |   .4548707    .253939     1.79   0.073    -.0428406     .952582
  response_t |   .0084858   .0970939     0.09   0.930    -.1818147    .1987863
   wrong_ans |   .0734197   .0845863     0.87   0.385    -.0923664    .2392057
       1.sex |  -.4325826   .2173111    -1.99   0.047    -.8585045   -.0066607
       _cons |  -.9800602   .3701226    -2.65   0.008    -1.705487   -.2546332
------------------------------------------------------------------------------

.         eststo reg1

. 
. ** Marginal effects by choice
.         local i "1 2 3"

.         foreach i in 1 2 3 {
  2.         quietly margins, dydx(*) at((means) _all (base) _factor) predict(outcome(`i')) post
  3.         eststo Choice`i'
  4.         estimates restore reg1
  5.         }
(results reg1 are active now)
(results reg1 are active now)
(results reg1 are active now)

. 
.         estout Choice1 Choice2 Choice3 using output12.tex, replace cells(b(star fmt(3)) se(par fmt(3))) style(tex)  stats(N, labels("N")  fmt(0 3)) prefoot(\hline
> ) starlevels(* 0.10 ** 0.05 *** 0.01) posthead(\hline) varlabels(1.RC_FP "\ \ Low (Fixed Pairs)"  3.RC_FP "\ \ High  (Fixed Pairs)"  1.RC_MG "\ \ Low (Mixed Group
> s)"  3.RC_MG "\ \ High (Mixed Groups)"  1.order "Order 12-12-2-2" Gains "Realized Gains"    game Supergame  wrong_ans "Incorrect Answers" _cons Constant male Male
>  response_t "Response Time" 1.sex "Male" ) 
(file output12.tex not found)
(output written to output12.tex)

. 
. restore

. 
. 
. 
. *=============================================================
. *       MULTINOMIAL LOGIT (individual level)-  GROUP CHOICES for a TYPE 
. *=============================================================
. use $data 

. preserve

.         drop if game==5
(18,384 observations deleted)

. 
.         *** CHOOSE the treatment (do ti for all treatments)
.         keep if treat==1
(56,112 observations deleted)

.         macro define controls "sex response_t wrong_ans"                

. 
.         collapse  choice otherchoice profit outcome vote* $controls , by (treatment sessionID game country groupsize ID order)

. 
.         gen profitP=profit if groupsize ==2
(384 missing values generated)

.         gen profitMG=profit if groupsize ==12
(384 missing values generated)

. 
. *       COLLAPSE by ID/ SESSION:     [voteNEW=1,2,3=leave,exclude,stay ]
.         collapse  profitP profitMG  vote1 vote2 vote3 voteNEW  $controls, by (treatment sessionID  country ID order)

.         gen Gains=profitMG - profitP

.         center  response_t wrong_ans  Gains, inplace  standardize 
(modified variables: response_t wrong_ans Gains)

.                 
. **      MULTINOMIAL LOGIT
.         macro define controls "response_t  wrong_ans   i.sex"    

.         est clear 

.         mlogit voteNEW    ib1.country   c.Gains  i.order    $controls, cluster(session)

Iteration 0:   log pseudolikelihood = -200.05945  
Iteration 1:   log pseudolikelihood =  -180.3347  
Iteration 2:   log pseudolikelihood = -179.27852  
Iteration 3:   log pseudolikelihood = -179.26907  
Iteration 4:   log pseudolikelihood = -179.26907  

Multinomial logistic regression                         Number of obs =    192
                                                        Wald chi2(5)  =      .
                                                        Prob > chi2   =      .
Log pseudolikelihood = -179.26907                       Pseudo R2     = 0.1039

                              (Std. err. adjusted for 8 clusters in sessionID)
------------------------------------------------------------------------------
             |               Robust
     voteNEW | Coefficient  std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
1            |  (base outcome)
-------------+----------------------------------------------------------------
2            |
     country |
     Middle  |   .5165592   .5469891     0.94   0.345    -.5555198    1.588638
     Advan.  |   .2827143     .47608     0.59   0.553    -.6503855    1.215814
             |
       Gains |   .6689319    .280922     2.38   0.017     .1183348    1.219529
             |
       order |
large first  |   .4271876   .4964732     0.86   0.390     -.545882    1.400257
  response_t |     .07412    .100828     0.74   0.462    -.1234993    .2717393
   wrong_ans |   .0188018    .118398     0.16   0.874     -.213254    .2508576
       1.sex |   .2753378   .4276218     0.64   0.520    -.5627854    1.113461
       _cons |  -.8912768   .7093637    -1.26   0.209    -2.281604    .4990506
-------------+----------------------------------------------------------------
3            |
     country |
     Middle  |  -.3647279   .5519967    -0.66   0.509    -1.446622    .7171658
     Advan.  |  -.3806329   .5091677    -0.75   0.455    -1.378583    .6173175
             |
       Gains |   1.236795   .2726775     4.54   0.000     .7023573    1.771233
             |
       order |
large first  |    1.50088   .6060107     2.48   0.013     .3131208    2.688639
  response_t |   .4627335   .1659767     2.79   0.005     .1374252    .7880418
   wrong_ans |    .030923   .1315594     0.24   0.814    -.2269287    .2887747
       1.sex |   .3723171   .6063452     0.61   0.539    -.8160978    1.560732
       _cons |  -1.785835   .6000822    -2.98   0.003    -2.961974   -.6096951
------------------------------------------------------------------------------

.         eststo reg1

. 
. ** Marginal effects by choice
.         local i "1 2 3"

.         foreach i in 1 2 3 {
  2.         quietly margins, dydx(*) at((means) _all (base) _factor) predict(outcome(`i')) post
  3.         eststo Choice`i'
  4.         estimates restore reg1
  5.         }
(results reg1 are active now)
(results reg1 are active now)
(results reg1 are active now)

. 
.         estout Choice1 Choice2 Choice3 using output13.tex, replace cells(b(star fmt(3)) se(par fmt(3))) style(tex)  stats(N, labels("N")  fmt(0 3)) prefoot(\hline
> ) starlevels(* 0.10 ** 0.05 *** 0.01) posthead(\hline) varlabels(2.country "Middle" 3.country "Advantaged" 1.order "Order 12-12-2-2" Gains "Realized Gains"    gam
> e Supergame  wrong_ans "Incorrect Answers" _cons Constant male Male response_t "Response Time" 1.sex "Male" ) 
(file output13.tex not found)
(output written to output13.tex)

. 
.         eststo drop Choice1 Choice2 Choice3
(Choice1 dropped)
(Choice2 dropped)
(Choice3 dropped)

. 
.         estimates restore reg1
(results reg1 are active now)

.         margins, dydx(*) at((means) _all (base) _factor) post

Conditional marginal effects                               Number of obs = 192
Model VCE: Robust

dy/dx wrt: 2.country 3.country Gains 1.order response_t wrong_ans 1.sex

1._predict: Pr(voteNEW==1), predict(pr outcome(1))
2._predict: Pr(voteNEW==2), predict(pr outcome(2))
3._predict: Pr(voteNEW==3), predict(pr outcome(3))

At: country    =         1
    Gains      = -1.27e-09 (mean)
    order      =         0
    response_t =  4.75e-08 (mean)
    wrong_ans  =  2.96e-08 (mean)
    sex        =         0

------------------------------------------------------------------------------
             |            Delta-method
             |      dy/dx   std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
1.country    |  (base outcome)
-------------+----------------------------------------------------------------
2.country    |
    _predict |
          1  |  -.0794445   .1112991    -0.71   0.475    -.2975869    .1386978
          2  |   .1211682   .0982569     1.23   0.218    -.0714119    .3137483
          3  |  -.0417237   .0386401    -1.08   0.280    -.1174569    .0340096
-------------+----------------------------------------------------------------
3.country    |
    _predict |
          1  |  -.0309217   .1055537    -0.29   0.770    -.2378033    .1759598
          2  |   .0681039   .0785292     0.87   0.386    -.0858105    .2220184
          3  |  -.0371822    .029329    -1.27   0.205     -.094666    .0203016
-------------+----------------------------------------------------------------
Gains        |
    _predict |
          1  |  -.1935022   .0486824    -3.97   0.000    -.2889179   -.0980864
          2  |   .0945213   .0488672     1.93   0.053    -.0012565    .1902992
          3  |   .0989808    .037072     2.67   0.008      .026321    .1716407
-------------+----------------------------------------------------------------
0.order      |  (base outcome)
-------------+----------------------------------------------------------------
1.order      |
    _predict |
          1  |  -.2137637   .1249723    -1.71   0.087    -.4587049    .0311775
          2  |   .0041381   .0838264     0.05   0.961    -.1601586    .1684348
          3  |   .2096256   .0741448     2.83   0.005     .0643045    .3549467
-------------+----------------------------------------------------------------
response_t   |
    _predict |
          1  |  -.0433754   .0183953    -2.36   0.018    -.0794296   -.0073212
          2  |   .0014772   .0198739     0.07   0.941     -.037475    .0404293
          3  |   .0418982   .0133878     3.13   0.002     .0156587    .0681378
-------------+----------------------------------------------------------------
wrong_ans    |
    _predict |
          1  |  -.0051802    .024766    -0.21   0.834    -.0537206    .0433602
          2  |   .0027628   .0208671     0.13   0.895     -.038136    .0436616
          3  |   .0024174   .0110706     0.22   0.827    -.0192806    .0241154
-------------+----------------------------------------------------------------
0.sex        |  (base outcome)
-------------+----------------------------------------------------------------
1.sex        |
    _predict |
          1  |  -.0730778   .0955433    -0.76   0.444    -.2603392    .1141836
          2  |   .0429231   .0774641     0.55   0.580    -.1089038      .19475
          3  |   .0301547   .0652345     0.46   0.644    -.0977027     .158012
------------------------------------------------------------------------------
Note: dy/dx for factor levels is the discrete change from the base level.

.                 
. ** ARE THERE DIFFERENT VOTING OUTCOMES ACROSS COUNTRIES 2 AND 3?
.         test [2.country]1._predict =[3.country]1._predict 

 ( 1)  [2.country]1bn._predict - [3.country]1bn._predict = 0

           chi2(  1) =    0.62
         Prob > chi2 =    0.4309

.         test [2.country]2._predict =[3.country]2._predict 

 ( 1)  [2.country]2._predict - [3.country]2._predict = 0

           chi2(  1) =    0.67
         Prob > chi2 =    0.4134

.         test [2.country]3._predict =[3.country]3._predict 

 ( 1)  [2.country]3._predict - [3.country]3._predict = 0

           chi2(  1) =    0.02
         Prob > chi2 =    0.8772

. 
. restore

. 
.         
. **== NEUTRAL-CHAT only (no order variable here) ==**
. use $data 

. preserve

.         drop if game==5
(18,384 observations deleted)

.         keep if treat==5
(63,456 observations deleted)

.         macro define controls "sex response_t wrong_ans"                

. 
.  *** COLLAPSE by ID in SUPERGAME
.         collapse  choice otherchoice profit outcome vote* $controls , by (sessionID game country groupsize ID)

. 
.         gen profitP=profit if groupsize ==2
(192 missing values generated)

.         gen profitMG=profit if groupsize ==12
(192 missing values generated)

. 
. *       COLLAPSE by ID/ SESSION:     [voteNEW=1,2,3=leave,exclude,stay ]
.         collapse  profitP profitMG  vote1 vote2 vote3 voteNEW  $controls, by (sessionID  country ID)

.         gen Gains=profitMG - profitP

.         center  response_t wrong_ans  Gains, inplace  standardize 
(modified variables: response_t wrong_ans Gains)

.                 
. **      MULTINOMIAL LOGIT
.         macro define controls "response_t  wrong_ans   i.sex"    

.         est clear 

.         mlogit voteNEW    ib1.country   c.Gains   $controls, cluster(session)

Iteration 0:   log pseudolikelihood = -87.963795  
Iteration 1:   log pseudolikelihood =  -75.93127  
Iteration 2:   log pseudolikelihood =  -74.44957  
Iteration 3:   log pseudolikelihood = -74.197874  
Iteration 4:   log pseudolikelihood = -74.143506  
Iteration 5:   log pseudolikelihood = -74.132627  
Iteration 6:   log pseudolikelihood = -74.130163  
Iteration 7:   log pseudolikelihood = -74.129556  
Iteration 8:   log pseudolikelihood = -74.129434  
Iteration 9:   log pseudolikelihood = -74.129407  
Iteration 10:  log pseudolikelihood = -74.129401  

Multinomial logistic regression                         Number of obs =     96
                                                        Wald chi2(2)  =      .
                                                        Prob > chi2   =      .
Log pseudolikelihood = -74.129401                       Pseudo R2     = 0.1573

                              (Std. err. adjusted for 4 clusters in sessionID)
------------------------------------------------------------------------------
             |               Robust
     voteNEW | Coefficient  std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
1            |
     country |
     Middle  |  -15.42959   .7606998   -20.28   0.000    -16.92053   -13.93865
     Advan.  |  -.6085017   .3806108    -1.60   0.110    -1.354485    .1374817
             |
       Gains |  -.7679391   .2845064    -2.70   0.007    -1.325561   -.2103167
  response_t |  -.5745935   .3111657    -1.85   0.065    -1.184467      .03528
   wrong_ans |  -.6073347   .2479068    -2.45   0.014    -1.093223   -.1214462
       1.sex |  -.5234403   1.186075    -0.44   0.659    -2.848104    1.801223
       _cons |  -1.311957   .4537042    -2.89   0.004      -2.2012   -.4227128
-------------+----------------------------------------------------------------
2            |
     country |
     Middle  |   .8381947   .3363867     2.49   0.013     .1788889    1.497501
     Advan.  |   .3232319   .4092611     0.79   0.430    -.4789052    1.125369
             |
       Gains |  -.4075417   .2486238    -1.64   0.101    -.8948353     .079752
  response_t |  -.5819549   .2055108    -2.83   0.005    -.9847487   -.1791612
   wrong_ans |  -.0254477   .3636089    -0.07   0.944    -.7381081    .6872127
       1.sex |   1.150246   .3145149     3.66   0.000      .533808    1.766684
       _cons |  -1.052594   .3817556    -2.76   0.006    -1.800821   -.3043668
-------------+----------------------------------------------------------------
3            |  (base outcome)
------------------------------------------------------------------------------

.         eststo reg1

. 
. ** Marginal effects by choice
.         local i "1 2 3"

.         foreach i in 1 2 3 {
  2.         quietly margins, dydx(*) at((means) _all (base) _factor) predict(outcome(`i')) post
  3.         eststo Choice`i'
  4.         estimates restore reg1
  5.         }
(results reg1 are active now)
(results reg1 are active now)
(results reg1 are active now)

. 
.         estout Choice1 Choice2 Choice3 using output14.tex, replace cells(b(star fmt(3)) se(par fmt(3))) style(tex)  stats(N, labels("N")  fmt(0 3)) prefoot(\hline
> ) starlevels(* 0.10 ** 0.05 *** 0.01) posthead(\hline) varlabels(2.country "Middle" 3.country "Advantaged" Gains "Realized Gains"    game Supergame  wrong_ans "In
> correct Answers" _cons Constant male Male response_t "Response Time" 1.sex "Male" ) 
(file output14.tex not found)
(output written to output14.tex)

. 
.         eststo drop Choice1 Choice2 Choice3
(Choice1 dropped)
(Choice2 dropped)
(Choice3 dropped)

. 
.         estimates restore reg1
(results reg1 are active now)

.         margins, dydx(*) at((means) _all (base) _factor) post

Conditional marginal effects                                Number of obs = 96
Model VCE: Robust

dy/dx wrt: 2.country 3.country Gains response_t wrong_ans 1.sex

1._predict: Pr(voteNEW==1), predict(pr outcome(1))
2._predict: Pr(voteNEW==2), predict(pr outcome(2))
3._predict: Pr(voteNEW==3), predict(pr outcome(3))

At: country    =         1
    Gains      =  1.77e-08 (mean)
    response_t = -9.26e-08 (mean)
    wrong_ans  = -5.65e-08 (mean)
    sex        =         0

------------------------------------------------------------------------------
             |            Delta-method
             |      dy/dx   std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
1.country    |  (base outcome)
-------------+----------------------------------------------------------------
2.country    |
    _predict |
          1  |  -.1664022   .0588705    -2.83   0.005    -.2817863   -.0510181
          2  |   .2309301   .0729518     3.17   0.002     .0879472    .3739129
          3  |  -.0645279   .1264561    -0.51   0.610    -.3123772    .1833214
-------------+----------------------------------------------------------------
3.country    |
    _predict |
          1  |  -.0764318   .0473167    -1.62   0.106    -.1691709    .0163072
          2  |   .0803897   .0676201     1.19   0.235    -.0521433    .2129228
          3  |  -.0039579   .0966005    -0.04   0.967    -.1932914    .1853756
-------------+----------------------------------------------------------------
Gains        |
    _predict |
          1  |  -.0918966   .0524621    -1.75   0.080    -.1947204    .0109272
          2  |   -.041379   .0537375    -0.77   0.441    -.1467026    .0639446
          3  |   .1332756   .0338726     3.93   0.000     .0668865    .1996647
-------------+----------------------------------------------------------------
response_t   |
    _predict |
          1  |  -.0588177   .0447523    -1.31   0.189    -.1465306    .0288952
          2  |  -.0778215   .0261109    -2.98   0.003    -.1289978   -.0266452
          3  |   .1366392   .0473094     2.89   0.004     .0439145    .2293638
-------------+----------------------------------------------------------------
wrong_ans    |
    _predict |
          1  |  -.0833316   .0341646    -2.44   0.015     -.150293   -.0163702
          2  |   .0174917    .055666     0.31   0.753    -.0916115     .126595
          3  |   .0658399   .0781535     0.84   0.400    -.0873382    .2190179
-------------+----------------------------------------------------------------
0.sex        |  (base outcome)
-------------+----------------------------------------------------------------
1.sex        |
    _predict |
          1  |  -.0958712   .0887443    -1.08   0.280    -.2698068    .0780643
          2  |   .2717331   .0534141     5.09   0.000     .1670435    .3764227
          3  |  -.1758619   .0721204    -2.44   0.015    -.3172152   -.0345086
------------------------------------------------------------------------------
Note: dy/dx for factor levels is the discrete change from the base level.

.                 
. ** ARE THERE DIFFERENT VOTING OUTCOMES ACROSS TYPES 2 AND 3?
.         test [2.country]1._predict =[3.country]1._predict 

 ( 1)  [2.country]1bn._predict - [3.country]1bn._predict = 0

           chi2(  1) =   24.70
         Prob > chi2 =    0.0000

.         test [2.country]2._predict =[3.country]2._predict 

 ( 1)  [2.country]2._predict - [3.country]2._predict = 0

           chi2(  1) =    2.37
         Prob > chi2 =    0.1237

.         test [2.country]3._predict =[3.country]3._predict 

 ( 1)  [2.country]3._predict - [3.country]3._predict = 0

           chi2(  1) =    0.30
         Prob > chi2 =    0.5834

. 
. restore

. 
.         
.         
. *==============================================================
. *               DISTRIBUTION OF VOTES by TYPE (1 obs = 1 type in a  session)
. *==============================================================
.         use $data

.         preserve

.                 keep if game==5 & period==1
(89,112 observations deleted)

.         
.                 by treat, sort: groups(vote)

--------------------------------------------------------------------------------------------------------------------------------------------------------------------
-> treatment = Neutral

  +---------------------------------------+
  |       vote   Freq.   Percent     % <= |
  |---------------------------------------|
  |      Leave      90     46.88    46.88 |
  | Out Disad.      31     16.15    63.02 |
  | Out Middle      16      8.33    71.35 |
  | Out Advan.      17      8.85    80.21 |
  |       Stay      38     19.79   100.00 |
  +---------------------------------------+

--------------------------------------------------------------------------------------------------------------------------------------------------------------------
-> treatment = Converge

  +---------------------------------------+
  |       vote   Freq.   Percent     % <= |
  |---------------------------------------|
  |      Leave      90     46.88    46.88 |
  | Out Disad.      10      5.21    52.08 |
  | Out Middle      21     10.94    63.02 |
  | Out Advan.      24     12.50    75.52 |
  |       Stay      47     24.48   100.00 |
  +---------------------------------------+

--------------------------------------------------------------------------------------------------------------------------------------------------------------------
-> treatment = Diverge

  +---------------------------------------+
  |       vote   Freq.   Percent     % <= |
  |---------------------------------------|
  |      Leave      88     45.83    45.83 |
  | Out Disad.      29     15.10    60.94 |
  | Out Middle      10      5.21    66.15 |
  | Out Advan.      33     17.19    83.33 |
  |       Stay      32     16.67   100.00 |
  +---------------------------------------+

--------------------------------------------------------------------------------------------------------------------------------------------------------------------
-> treatment = Neutral+

  +---------------------------------------+
  |       vote   Freq.   Percent     % <= |
  |---------------------------------------|
  |      Leave      60     31.25    31.25 |
  | Out Disad.      28     14.58    45.83 |
  | Out Middle      19      9.90    55.73 |
  | Out Advan.      25     13.02    68.75 |
  |       Stay      60     31.25   100.00 |
  +---------------------------------------+

--------------------------------------------------------------------------------------------------------------------------------------------------------------------
-> treatment = Neutral-Chat

  +---------------------------------------+
  |       vote   Freq.   Percent     % <= |
  |---------------------------------------|
  |      Leave       8      8.33     8.33 |
  | Out Disad.      24     25.00    33.33 |
  | Out Middle       7      7.29    40.63 |
  | Out Advan.       8      8.33    48.96 |
  |       Stay      49     51.04   100.00 |
  +---------------------------------------+

.         
.                 collapse vote1 vote2 vote3, by(treatment sessionID country)

.                         
.                 table (country) (treat), statistic(mean  vote1)  statistic(sd vote1)  nformat(%9.2f) nototals

--------------------------------------------------------------------------------
                       |                         Treatment                      
                       |  Neutral   Converge   Diverge   Neutral+   Neutral-Chat
-----------------------+--------------------------------------------------------
Country                |                                                        
  Disadv.              |                                                        
    Mean               |     0.42       0.27      0.47       0.27           0.16
    Standard deviation |     0.26       0.24      0.19       0.17           0.16
  Middle               |                                                        
    Mean               |     0.44       0.48      0.38       0.36           0.00
    Standard deviation |     0.20       0.16      0.18       0.19           0.00
  Advan.               |                                                        
    Mean               |     0.55       0.66      0.53       0.31           0.09
    Standard deviation |     0.22       0.15      0.21       0.22           0.06
--------------------------------------------------------------------------------

.                 table (country) (treat) , statistic(mean  vote2)  statistic(sd vote2)  nformat(%9.2f) nototals

--------------------------------------------------------------------------------
                       |                         Treatment                      
                       |  Neutral   Converge   Diverge   Neutral+   Neutral-Chat
-----------------------+--------------------------------------------------------
Country                |                                                        
  Disadv.              |                                                        
    Mean               |     0.28       0.45      0.36       0.38           0.28
    Standard deviation |     0.23       0.20      0.21       0.23           0.12
  Middle               |                                                        
    Mean               |     0.41       0.23      0.48       0.39           0.53
    Standard deviation |     0.16       0.17      0.21       0.17           0.21
  Advan.               |                                                        
    Mean               |     0.31       0.17      0.28       0.36           0.41
    Standard deviation |     0.12       0.09      0.17       0.10           0.21
--------------------------------------------------------------------------------

.                 table (country) (treat) , statistic(mean  vote3)  statistic(sd vote3)  nformat(%9.2f) nototals

--------------------------------------------------------------------------------
                       |                         Treatment                      
                       |  Neutral   Converge   Diverge   Neutral+   Neutral-Chat
-----------------------+--------------------------------------------------------
Country                |                                                        
  Disadv.              |                                                        
    Mean               |     0.30       0.28      0.17       0.36           0.56
    Standard deviation |     0.22       0.26      0.11       0.19           0.22
  Middle               |                                                        
    Mean               |     0.16       0.28      0.14       0.25           0.47
    Standard deviation |     0.11       0.21      0.14       0.21           0.21
  Advan.               |                                                        
    Mean               |     0.14       0.17      0.19       0.33           0.50
    Standard deviation |     0.14       0.13      0.13       0.20           0.18
--------------------------------------------------------------------------------

.         restore

.         
. 
. 
. *=====================================
. *       TABLE: GROUP CHOICES & MAJORITIES
. *=====================================
. *       How many groups of size 24 were formed in game 5?
.         preserve

.                 collapse ymd if game==5,  by(treat sessionID groupsize)

.                 groups(groupsize)

  +-------------------------------------+
  | groups~e   Freq.   Percent     % <= |
  |-------------------------------------|
  |        2      28     43.75    43.75 |
  |       16      28     43.75    87.50 |
  |       24       8     12.50   100.00 |
  +-------------------------------------+

.                 tab treat groupsize

             |           Economy Size
   Treatment |         2         16         24 |     Total
-------------+---------------------------------+----------
     Neutral |         8          8          0 |        16 
    Converge |         6          6          2 |        14 
     Diverge |         7          7          1 |        15 
    Neutral+ |         5          5          3 |        13 
Neutral-Chat |         2          2          2 |         6 
-------------+---------------------------------+----------
       Total |        28         28          8 |        64 

.         restore 

. 
. * N. of obs. for 2-player groups, 12-player groups, 16-player group and 24-player groups.
.         bysort groupsize: distinct groupID if game<5 

--------------------------------------------------------------------------------------------------------------------------------------------------------------------
-> groupsize = 2

--------------------------------
         |     total   distinct
---------+----------------------
 groupID |     35400        864
--------------------------------

--------------------------------------------------------------------------------------------------------------------------------------------------------------------
-> groupsize = 12

--------------------------------
         |     total   distinct
---------+----------------------
 groupID |     36192        144
--------------------------------

--------------------------------------------------------------------------------------------------------------------------------------------------------------------
-> groupsize = 16

--------------------------------
         |     total   distinct
---------+----------------------
 groupID |         0          0
--------------------------------

--------------------------------------------------------------------------------------------------------------------------------------------------------------------
-> groupsize = 24

--------------------------------
         |     total   distinct
---------+----------------------
 groupID |         0          0
--------------------------------

.         bysort groupsize: distinct groupID if game==5

--------------------------------------------------------------------------------------------------------------------------------------------------------------------
-> groupsize = 2

--------------------------------
         |     total   distinct
---------+----------------------
 groupID |      4792        112
--------------------------------

--------------------------------------------------------------------------------------------------------------------------------------------------------------------
-> groupsize = 12

--------------------------------
         |     total   distinct
---------+----------------------
 groupID |         0          0
--------------------------------

--------------------------------------------------------------------------------------------------------------------------------------------------------------------
-> groupsize = 16

--------------------------------
         |     total   distinct
---------+----------------------
 groupID |      9584         28
--------------------------------

--------------------------------------------------------------------------------------------------------------------------------------------------------------------
-> groupsize = 24

--------------------------------
         |     total   distinct
---------+----------------------
 groupID |      4008          8
--------------------------------

.         
. *       How many votes did each choice get? Calculate what was the majority vote (by country and treat)
.         local votes "1 2 3"

.                 foreach i of local votes {
  2.                 by treat sessionID country (ID), sort: egen temp`i'=total(voteNEW==`i') if game==1 & period==1
  3.                 by treat sessionID country (game period), sort: gen temp=temp`i'[1]
  4.                 replace temp`i'=temp
  5.                 drop temp
  6.                 }
(89,112 missing values generated)
(89,112 real changes made)
(89,112 missing values generated)
(89,112 real changes made)
(89,112 missing values generated)
(89,112 real changes made)

.         
.         sort treat sessionID game period country  ID 

. 
. * Find the majority vote (8 players per country), consider there can be ties (e.g, 2 3 3   or 4 0 4)
. * Majority vote in a country (1=leave, 2=exclude, 3=stay, 12=equal 1 & 2 votes, etc.)
.         by treat sessionID country, sort: gen majority=1 if temp1==max(temp1,temp2, temp3) & temp1!=temp2 & temp1!=temp3
(52,592 missing values generated)

.         by treat sessionID country, sort: replace majority=2 if temp2==max(temp1,temp2, temp3) & temp2!=temp1 & temp2!=temp3
(22,928 real changes made)

.         by treat sessionID country, sort: replace majority=3 if temp3==max(temp1,temp2, temp3) & temp3!=temp1 & temp3!=temp2
(14,480 real changes made)

.         by treat sessionID country, sort: replace majority=12 if majority==. & temp1==temp2
(7,608 real changes made)

.         by treat sessionID country, sort: replace majority=13 if majority==. & temp1==temp3
(2,440 real changes made)

.         by treat sessionID country, sort: replace majority=23 if majority==. & temp2==temp3
(5,136 real changes made)

. drop temp*

. 
end of do-file

. exit, clear
